Select.holgame{ //initialize deck of cards //single card: disp value, actual value for hol, suit icon, color deck = ("A,50,♠,gray","2,2,♠,gray","3,3,♠,gray","4,4,♠,gray","5,5,♠,gray", "6,6,♠,gray","7,7,♠,gray", "8,8,♠,gray","9,9,♠,gray","10,10,♠,gray","J,11,♠,gray", "Q,12,♠,gray","K,13,♠,gray",/ "A,50,♥,red","2,2,♥,red","3,3,♥,red","4,4,♥,red","5,5,♥,red", "6,6,♥,red","7,7,♥,red", "8,8,♥,red","9,9,♥,red","10,10,♥,red","J,11,♥,red","Q,12,♥,red","K,13,♥,red",/ "A,50,♣,gray","2,2,♣,gray","3,3,♣,gray","4,4,♣,gray", "5,5,♣,gray", "6,6,♣,gray", "7,7,♣,gray","8,8,♣,gray","9,9,♣,gray", "10,10,♣,gray","J,11,♣,gray","Q,12,♣,gray","K,13,♣,gray",/ "A,50,♦,red","2,2,♦,red","3,3,♦,red","4,4,♦,red","5,5,♦,red", "6,6,♦,red", "7,7,♦,red","8,8,♦,red","9,9,♦,red","10,10,♦,red", "J,11,♦,red","Q,12,♦,red","K,13,♦,red",); card = "" HOLPoints = 0 HOLGuesses = 0 //correct guesses OnPlayHOL } OnPlayHOL { if reference0 == "rules" { "\s[0]\0The rules for this game are simple.\w8 I'll show you a card, and you guess if the next card in the deck is higher or lower. Aces are the highest, and 2's are the lowest. Got it?\w8\x" } else { //pick a random card, keep old card for comparison oldcard = card _rand = RAND(ARRAYSIZE(deck)-1) card = deck[_rand] //remove card from deck deck[_rand] = IARRAY } -- if ARRAYSIZE(deck) == 0 {//if user gets through the whole deck HOLComplete } if reference0 == "higher"{ //new card lower than old card if TOINT(oldcard[1]) > TOINT(card[1]) { "\s[3]Oh no...\n\w4%(newcarddisp) is lower than %(oldcarddisp).\w8 Sadly, that means you lose u_u\w8\n\n" -- "\_q\![*]\q[Play again?,holgame] or...\n\n[half]" -- "\0\s[0]Back to...\n\n[half]" -- "\![*]\q[Games menu,OnGamesMenu]\n/ \![*]\q[Main menu,OnBACKTOMENU]\e" } elseif TOINT(oldcard[1]) < TOINT(card[1]) { //new card higher than old card //increase winnings HOLPoints +=2 HOLGuesses++ "\s[5]Yep!\w8 %(newcarddisp) is higher than %(oldcarddisp) !\w8 Next card!\x" -- "\s[0]Top Card: %(newcarddisp)\n\n" -- "\_qDo you think the next card is:\n/ \![*]\q[Higher?,OnPlayHOL,higher]\n/ \![*]\q[Lower?,OnPlayHOL,lower]\n\n[half]" -- "\![*]\q[View rules,OnPlayHOL,rules]\n/ \![*]\q[Stop and collect %(HOLPoints) AP,HOLOver]\e" } else { //same value "\s[8]Huh.\w8%(newcarddisp) has the same value as %(oldcarddisp).\w8 Let's try that again...\x" -- "\s[0]Top Card: %(newcarddisp)\n\n" -- "\_qDo you think the next card is:\n/ \![*]\q[Higher?,OnPlayHOL,higher]\n/ \![*]\q[Lower?,OnPlayHOL,lower]\n\n[half]" -- "\![*]\q[View rules,OnPlayHOL,rules]\n/ \![*]\q[Stop and collect %(HOLPoints) AP,HOLOver]\e" } } elseif reference0 == "lower" { //new card higher than old card if TOINT(oldcard[1]) < TOINT(card[1]) { "\s[3]Oh no...\n\w4%(newcarddisp) is higher than %(oldcarddisp).\w8 Sadly, that means you lose u_u\w8\n\n" -- "\_q\![*]\q[Play again?,holgame] or...\n\n[half]" -- "\0\s[0]Back to...\n\n[half]" -- "\![*]\q[Games menu,OnGamesMenu]\n/ \![*]\q[Main menu,OnBACKTOMENU]\e" } elseif TOINT(oldcard[1]) > TOINT(card[1]) { //new card lower than old card //increase winnings HOLPoints +=2 HOLGuesses++ "\s[5]Yep!\w8 %(newcarddisp) is lower than %(oldcarddisp) !\w8 Next card!\x" -- "\s[0]Top Card: %(newcarddisp)\n\n" -- "\_qDo you think the next card is:\n/ \![*]\q[Higher?,OnPlayHOL,higher]\n/ \![*]\q[Lower?,OnPlayHOL,lower]\n\n[half]" -- "\![*]\q[View rules,OnPlayHOL,rules]\n/ \![*]\q[Stop and collect %(HOLPoints) AP,HOLOver]\e" } else { //same value "\s[8]Huh.\w8%(newcarddisp) has the same value as %(oldcarddisp).\w8 Let's try that again...\x" -- "\s[0]Top Card: %(newcarddisp)\n\n" -- "\_qDo you think the next card is:\n/ \![*]\q[Higher?,OnPlayHOL,higher]\n/ \![*]\q[Lower?,OnPlayHOL,lower]\n\n[half]" -- "\![*]\q[View rules,OnPlayHOL,rules]\n/ \![*]\q[Stop and collect %(HOLPoints) AP,HOLOver]\e" } } else { "\s[0]\0Top Card: %(newcarddisp)\n\n" -- "\_qDo you think the next card is:\n/ \![*]\q[Higher?,OnPlayHOL,higher]\n/ \![*]\q[Lower?,OnPlayHOL,lower]\n\n[half]/ \![*]\q[View rules,OnPlayHOL,rules]\e" } } Select.HOLOver { AP += HOLPoints //add winnings to players wallet "\0You got %(HOLPoints) AP and had a streak of %(HOLGuesses) ^_^\w8 Want to try again?\n\n" -- "\![*]\q[Yah,holgame]\n\n[half]" -- "Nah, back to...\n\n[half]" -- "\![*]\q[Games menu,OnGamesMenu]\n/ \![*]\q[Main menu,OnBACKTOMENU]\e" } HOLComplete { "\0\s[2]Whoa!!\w8 You really got through the whole deck?\w8 That's incredibly lucky...\w8 Maybe you should go buy a lotto ticket now, LOL.\w8\n\n" -- "\_q\![*]\q[Play again?,holgame] or...\n\n[half]" -- "\0\s[0]Back to...\n\n[half]" -- "\![*]\q[Games menu,OnGamesMenu]\n/ \![*]\q[Main menu,OnBACKTOMENU]\e" }