Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer letter;//1,2,3,4,5 = B,I,N,G,O = 1,16,31,46,61
- integer number;
- string combo;
- list BINGOList = [];
- string BINGOCard;
- list BINGOCardLineB = [];
- list BINGOCardLineI = [];
- list BINGOCardLineN = [];
- list BINGOCardLineG = [];
- list BINGOCardLineO = [];
- string BINGOString;
- makeList()
- {
- integer i = 0;
- integer length = 75;
- for (; i < length; ++i)
- {
- BINGOList += [i+1];
- }
- }
- seperateList()
- {
- integer i = 0;
- integer j = 0;
- string BINGO;
- integer length = 15;
- integer times = 5;
- for (; j < times; ++j)
- {
- if(j==0) BINGO = "B";
- else if(j==1) BINGO = "I";
- else if(j==2) BINGO = "N";
- else if(j==3) BINGO = "G";
- else if(j==4) BINGO = "O";
- for (; i < length; ++i)
- {
- BINGOString += BINGO + llList2String(BINGOList, i) + ", ";
- }
- length += 15;
- BINGOString += "\n";
- }
- }
- makeCard()
- {
- integer i = 0;
- integer j = 0;
- string BINGO;
- list FREE = ["FREE"];
- list BINGOCardTemp = [];
- integer length = 15;
- integer times = 5;
- for (; j < times; ++j)
- {
- for (; i < length; ++i)
- {
- BINGOCardTemp += [i];
- }
- BINGOCardTemp = llListRandomize(BINGOCardTemp,1);
- if(j==0) {BINGOCardLineB = llDeleteSubList(BINGOCardTemp,5,15);BINGOCardTemp = [];}
- else if(j==1) {BINGOCardLineI = llDeleteSubList(BINGOCardTemp,5,14);BINGOCardTemp = [];}
- else if(j==2) {BINGOCardLineN = llDeleteSubList(BINGOCardTemp,4,14);BINGOCardTemp = [];BINGOCardLineN = llListInsertList(BINGOCardLineN,FREE,2);}
- else if(j==3) {BINGOCardLineG = llDeleteSubList(BINGOCardTemp,5,14);BINGOCardTemp = [];}
- else if(j==4) {BINGOCardLineO = llDeleteSubList(BINGOCardTemp,5,14);BINGOCardTemp = [];}
- length += 15;
- }
- BINGOCard += "\nB " + llList2CSV(BINGOCardLineB) + "\nI " + llList2CSV(BINGOCardLineI) + "\nN " + llList2CSV(BINGOCardLineN) + "\nG " + llList2CSV(BINGOCardLineG) + "\nO " + llList2CSV(BINGOCardLineO);
- }
- default
- {
- state_entry()
- {
- makeList();
- //llSay(0, llList2CSV(BINGOList));
- seperateList();
- // llSay(0, llList2CSV(BINGOString));
- makeCard();
- llSay(0, BINGOCard);
- }
- touch_start(integer n)
- {
- letter = (integer)llFrand(5)+1;
- number = (integer)llFrand(15)+1;
- if(letter == 1)
- {
- number += 0;
- combo = "B"+(string)number;
- }
- else if(letter == 2)
- {
- number += 15;
- combo = "I"+(string)number;
- }
- else if(letter == 3)
- {
- number += 30;
- combo = "N"+(string)number;
- }
- else if(letter == 4)
- {
- number += 45;
- combo = "G"+(string)number;
- }
- else if(letter == 5)
- {
- number += 60;
- combo = "O"+(string)number;
- }
- llSay(0, combo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment