Original author: Bill Palmby.
ORIGINAL:Original game did randomize three cards.
Then two first cards was revealed to player while third card still hided.
After this, player had to choose do he believe that third card is between two revealed cards.
So basicly, if revealed cards were (13) and (8), player were asked do he believe third card is 9, 10, 11 or 12.
If player did think so, he could bet for it. If player didn't believe it, he just pressed <ENTER> and next turn started with two new revealed cards and third one that were hided.
If player did bet, he either win or loose, depending was third card between two revealed ones.
Game did continue until player did loose all hes moneys or game was interrupted by keyboard.
TRANSPORTED:Transported version follows main idea of AceyDucey.
Instead of just randomizing card's, this version does create a real deck of cards with all four lands.
After deck is created, game shuffles the deck.
First two cards are revealed on screen while third is hided. Now player can either bet or just press <ENTER>.
After this, first of revealed cards is removed from game, second revealed card comes a first revealed card and third card wich was hided at first, comes as second revealed card. Fourth card in deck is now hided and player has to choose does he believe if it's between cards that are now revealed on screen.
Game continues as long there is cards in deck and player has money to bet.
E.K.Virtanen
' AceyDucey One Deck Match.
' Inspired by Bill Palmby. http://www.atariarchives.org/basicgames/showpage.php?page=2
' E.K.Virtanen 2007, Public Domain.
' www.ascii-world.com
Type Card
Value AS Integer
Land AS String
LColor AS Integer
END Type
DIM AS Card Cards(1 TO 52)
DECLARE SUB Create_Deck(Cards() AS Card)
DECLARE SUB CLR()
WINDOWTITLE "AceyDucey One Deck Match"
SCREEN 14 : CLR()
Create_Deck(Cards())
COLOR 1, 15
LOCATE 2, 7 : Print "AceyDucey One Deck Match."
LOCATE 4, 7 : Print "Inspired by Bill Palmby."
LOCATE 6, 3 : Print "E.K.Virtanen 2007, Public Domain."
LOCATE 7, 9 : Print "www.ascii-world.com"
COLOR 0, 15
Print ""
Print "You see two cards at once from deck."
Print ""
Print "If you believe that next card from deck"
Print "is between those two cards you see"
Print "on screen, or same than other of them,"
Print "you can bet money for it."
Print ""
Print "If you dont wana bet, then stake 0$."
Print ""
Print "Game ends if you loose all your moneys,"
Print "or when whole deck is played."
Print ""
Print "Press some key to play." : GETKEY
' /// let's play
DIM AS Integer DeckLoc, Money, Bigger, Smaller, Counter, Bet
DeckLoc = 3 : Money = 100
CLR()
DO
CLR() : Color 1, 15
' first, we check wich is bigger and wich is smaller card.
IF Cards(DeckLoc - 2).Value <= Cards(DeckLoc - 1).Value THEN
Smaller = Cards(DeckLoc - 2).Value
Bigger = Cards(DeckLoc - 1).Value
END IF
IF Cards(DeckLoc - 2).Value > Cards(DeckLoc - 1).Value THEN
Smaller = Cards(DeckLoc - 1).Value
Bigger = Cards(DeckLoc - 2).Value
END IF
LOCATE 10, 10 : Color Cards(DeckLoc - 2).LColor, 15
Print Cards(DeckLoc - 2).Value; Cards(DeckLoc - 2).Land
LOCATE 10, 29 : Color Cards(DeckLoc - 1).LColor, 15
Print Cards(DeckLoc - 1).Value; Cards(DeckLoc - 1).Land
LOCATE 12, 15 : Color 1, 15 : Print "Money: "; Money ; "$"
LOCATE 13, 10 : Print "Cards in deck: "; (52 - DeckLoc)
LOCATE 15, 10 : Color 0, 15 : Input "Do you bet and how much?"; Bet
LOCATE 17, 19 : Color Cards(DeckLoc).LColor, 15
Print Cards(DeckLoc).Value; Cards(DeckLoc).Land
IF Bet < 1 OR Bet > Money THEN
IF Cards(DeckLoc).Value >= Smaller AND Cards(DeckLoc).Value <= Bigger THEN
Color 1, 15
LOCATE 19, 5 : Print "Oh crab!!! Why you didn't bet?"
END IF
IF Cards(DeckLoc).Value < Smaller OR Cards(DeckLoc).Value > Bigger THEN
Color 4, 15
LOCATE 19, 2 : Print "Nice one. You saved your moneys here."
END IF
END IF
IF Bet > 0 AND Bet <= Money THEN
IF Cards(DeckLoc).Value >= Smaller AND Cards(DeckLoc).Value <= Bigger THEN
COLOR 4, 15
LOCATE 19, 6 : Print "Victory!!! You did win "; (Bet) ; "$"
Money = (Money + Bet)
END IF
IF Cards(DeckLoc).Value < Smaller OR Cards(DeckLoc).Value > Bigger THEN
COLOR 1, 15
LOCATE 19, 9 : Print "Oh shame, you loose "; Bet ; "$"
Money = (Money - Bet)
END IF
END IF
DeckLoc = DeckLoc + 1 : Bet = 0
GETKEY
Loop Until DeckLoc = 53 OR Money = 0
CLR() : Color 2, 15 :
LOCATE 20, 3 : Print "You ended with "; Money ; "$ in your pocket."
SLEEP
END
SUB Create_Deck(Cards() AS Card)
' we need some temp variables here.
DIM AS Card TempCard ' we use this when shufling deck.
DIM AS Integer SubInt, SubInt2
DIM AS Integer Colors(0 TO 4)
Colors(0) = 4 : Colors(1) = 4 : Colors(2) = 0 : Colors(2) = 0
' let's create a new deck.
For SubInt = 0 To 51
Cards(SubInt + 1).Land = CHR$(INT(SubInt Mod 4) + 3)
Cards(SubInt + 1).Value = (SubInt \ 4 + 1)
Cards(SubInt + 1).LColor = Colors(INT(SubInt Mod 4))
Next
' now we need to shuffle it for while.
DIM AS Double Timing = TIMER
DO
SubInt = INT(RND * 52) + 1
SubInt2 = INT(RND * 52) + 1
IF SubInt <> SubInt2 THEN
TempCard = Cards(SubInt)
Cards(SubInt) = Cards(SubInt2)
Cards(SubInt2) = TempCard
End IF
Loop Until (TIMER - Timing) > 3.0
END SUB
SUB CLR()
COLOR 15, 15 : CLS
END SUB