Deck of Cards
francisstokes
16 Jun 2005, 11:00Is it possible to make a working deck of cards, using arrays to store the cards and variables to store the cards that have been "picked up"?
I think Im Dead
16 Jun 2005, 19:32You could use arrays and such I guess. It would probably be better, though more time consuming, to create an object for each card with it's name(ex; 2 of spades, king of diamonds, etc.), then put all those cards in a room "card-room", then create an object simply called, "deck of cards" and give the object actions it responds to, so you could type "deal deck" and then run a check for each object in card-room, assign a number to each object, and pick a random number producing the random card object and dealing it to whoever. If you wanted you could even have 1-52 properties for the deck, and have it store how it's been shuffled.
Depending on how high I get today maybe I'll put together a card deck that can be used online to improvise card games. I do get pretty high though, so who knows.
Depending on how high I get today maybe I'll put together a card deck that can be used online to improvise card games. I do get pretty high though, so who knows.
MaDbRiT
16 Jun 2005, 20:34Francis wrote
Sure it is - but actually you only need the one numeric array with 52 elements (one for each card assuming you don't want jokers in the pack!) No other variables are actually needed.
I'd do it like so: (theoretically)
Array element 1 represents the ace of spades, element 2 the two of spades and so on... Once you exhaust the spades element 14 represents the ace of hearts - and so on until element 52 represents the King of diamonds.
A simple function can then return the value and suit of any card from its element number.
The actual array can then be used to store a number representing who holds the card, if it is on the stack or whatever.
e.g. (assumes the array was called 'deck'.)
Reading the element %deck[16]% would return the status of the 3 of hearts, (16 is the array position for the 3 of hearts as shown above) it might hold the player ID (in a multiplayer game) of the player who has it in his hand, zero, meaning it is on the stack, or (say) 9999 if it is in the discards and 'dead' to the card game.
So, a bit of lateral thinking is required, but one array and a simple function to name the card when required would do nicely.
Al (MaDbRiT)
Is it possible to make a working deck of cards, using arrays to store the cards and variables to store the cards that have been "picked
up"?
Sure it is - but actually you only need the one numeric array with 52 elements (one for each card assuming you don't want jokers in the pack!) No other variables are actually needed.
I'd do it like so: (theoretically)
Array element 1 represents the ace of spades, element 2 the two of spades and so on... Once you exhaust the spades element 14 represents the ace of hearts - and so on until element 52 represents the King of diamonds.
A simple function can then return the value and suit of any card from its element number.
The actual array can then be used to store a number representing who holds the card, if it is on the stack or whatever.
e.g. (assumes the array was called 'deck'.)
Reading the element %deck[16]% would return the status of the 3 of hearts, (16 is the array position for the 3 of hearts as shown above) it might hold the player ID (in a multiplayer game) of the player who has it in his hand, zero, meaning it is on the stack, or (say) 9999 if it is in the discards and 'dead' to the card game.
So, a bit of lateral thinking is required, but one array and a simple function to name the card when required would do nicely.
Al (MaDbRiT)
paul_one
16 Jun 2005, 21:25I'd like to add something to the discussion:
My way would be an array of numbers also. But instead of the index representing the card, I would use the index to represent the place of the card in the deck and have the value as the card.
Shuffling the cards would be nice, just picking two cards using the $rand()$ function and swapping them around. All it would need is one pointer that points to where the "dealer" is up to, and object properties/other arrays for different players holding the card.
I just like this way of thinking, means you don't rally have to check if someone has a card - or if the card has been "used". You can have odd card's, with values more - or less - than the "1-52" range. You can easily have 2 or more packs (just up the array to 104 instead of 52). You can have more than 4 suits etc. You could probably turn it into a library very easily.
I have to admit the basic idea wasn't mine though - it came from my father who wrote a cribbage game in BASIC back in the sinclair days - he even managed to sell it. But I see the way it can be expanded apon.
My way would be an array of numbers also. But instead of the index representing the card, I would use the index to represent the place of the card in the deck and have the value as the card.
Shuffling the cards would be nice, just picking two cards using the $rand()$ function and swapping them around. All it would need is one pointer that points to where the "dealer" is up to, and object properties/other arrays for different players holding the card.
I just like this way of thinking, means you don't rally have to check if someone has a card - or if the card has been "used". You can have odd card's, with values more - or less - than the "1-52" range. You can easily have 2 or more packs (just up the array to 104 instead of 52). You can have more than 4 suits etc. You could probably turn it into a library very easily.
I have to admit the basic idea wasn't mine though - it came from my father who wrote a cribbage game in BASIC back in the sinclair days - he even managed to sell it. But I see the way it can be expanded apon.
I think Im Dead
16 Jun 2005, 22:38Eh, for the purpose of a demonstration I went ahead and threw together an object demo like I briefly touched on earlier. Not sure if my router will let people through, but I'll leave this server up so people can connect and try out the deck of cards. The couple of commands are of course "get", then "shuffle", and "draw" all directed towards the deck of cards.
Questnet Card Room
The reason I liked my way of doing it, is if you don't like the way the game is going, you can stand up and leave with your cards. HAH!
I just always thought you could roleplay a lot with a deck of cards or just have fun in a MUD, especially if the deck had a few special commands to help you cheat. Can you tell I always played a rogue or a thief?
P.S. You can also drop the cards after you've drawn them, making the deck incomplete for others.
Questnet Card Room
The reason I liked my way of doing it, is if you don't like the way the game is going, you can stand up and leave with your cards. HAH!
I just always thought you could roleplay a lot with a deck of cards or just have fun in a MUD, especially if the deck had a few special commands to help you cheat. Can you tell I always played a rogue or a thief?
P.S. You can also drop the cards after you've drawn them, making the deck incomplete for others.
francisstokes
16 Jun 2005, 22:54I was thinking single player card game "engine" so that the deck is always there but you can make new card games using the "engine".
I understand what your saying ITID, but i can imagine it causing problems since its so messy.
MaDbRiT i can also uderstand what your saaying, but i dont understand how to make it so the cards that have been drawn wont appear again.
I understand what your saying ITID, but i can imagine it causing problems since its so messy.
MaDbRiT i can also uderstand what your saaying, but i dont understand how to make it so the cards that have been drawn wont appear again.
MaDbRiT
17 Jun 2005, 07:20Francis
Assume all the cards are in the deck (undealt)
This means all the array elements are set to 0 (0=in the deck).
You use a random number generator to get a number from 1 to 52, then assign the array element the value you decide means "dealt to a player".
e.g. the random number generated is 27 (27=index for ace of clubs) so array element 27 is set to 99 (99 being the completely arbitrary number i have decided to use to mean 'dealt to the player'). This value then indicates the player has drawn this particular card.
For the next (and subsequent) cards you use the same random number generator, but this time you test that the array element it points to is = 0 (meaning it hasn't already been dealt). If the random number generated is 27 again, the test of the element would return false and you'd repeat the random process until the test succeeded.
quick theoretical "code snippet" of what I'm thinking;
The idea is that each time this code was called it would effectively 'deal' a random card to the player, but never repeat a card he (or another player were it multiplayer) had already been dealt.
To return the cards to the pack and 'shuffle' all you'd need to do is reset all the array elements to 0..
You might well need to get a lot more elaborate than this concept - depending on how complex the card game(s) you want to simulate is/are. I'm not really a card player myself, but I suspect that some of the variations of Poker might be a bit of a pain to implement.
Al (MaDbRiT)
MaDbRiT i can also uderstand what your saaying, but i dont understand how to make it so the cards that have been drawn wont appear again.
Assume all the cards are in the deck (undealt)
This means all the array elements are set to 0 (0=in the deck).
You use a random number generator to get a number from 1 to 52, then assign the array element the value you decide means "dealt to a player".
e.g. the random number generated is 27 (27=index for ace of clubs) so array element 27 is set to 99 (99 being the completely arbitrary number i have decided to use to mean 'dealt to the player'). This value then indicates the player has drawn this particular card.
For the next (and subsequent) cards you use the same random number generator, but this time you test that the array element it points to is = 0 (meaning it hasn't already been dealt). If the random number generated is 27 again, the test of the element would return false and you'd repeat the random process until the test succeeded.
quick theoretical "code snippet" of what I'm thinking;
'get a new card from the deck
repeat until (%deck[dealt]%=0) {
set numeric <dealt;$rand(1,52)$>
}
set <deck[dealt];99>
The idea is that each time this code was called it would effectively 'deal' a random card to the player, but never repeat a card he (or another player were it multiplayer) had already been dealt.
To return the cards to the pack and 'shuffle' all you'd need to do is reset all the array elements to 0..
You might well need to get a lot more elaborate than this concept - depending on how complex the card game(s) you want to simulate is/are. I'm not really a card player myself, but I suspect that some of the variations of Poker might be a bit of a pain to implement.
Al (MaDbRiT)
francisstokes
19 Jun 2005, 21:06Even though it was untidy, i made an "object" version of the deck and it works well.
I made an object for every card and i wrothe a procedure for the deal command that deals you a card depending on the random number generated.
The idea is people use this like a library.The user leaves the cards alone and tweak the dealing procedure to suit their game, i.e: the player need seven cards dealt.
I made an object for every card and i wrothe a procedure for the deal command that deals you a card depending on the random number generated.
The idea is people use this like a library.The user leaves the cards alone and tweak the dealing procedure to suit their game, i.e: the player need seven cards dealt.
' "card engine"
' Writen by Francis Robert Stokes
'The following is to be filled in by the user with his/her info.
'Please send feedback to francis.stokes14@btinternet.com
'Thanks
define game <card engine>
asl-version <350>
gametype singleplayer
start <gameroom>
game author <>
game version <>
game info <>
end define
define synonyms
end define
define room <cardroom>
look <just a dummy!>
define object <Ace of spades>
end define
define object <2 of spades>
end define
define object <3 of spades>
end define
define object <4 of spades>
end define
define object <5 of spades>
end define
define object <6 of spades>
end define
define object <7 of spades>
end define
define object <8 of spades>
end define
define object <9 of spades>
end define
define object <10 of spades>
end define
define object <Jack of spades>
end define
define object <Queen of spades>
end define
define object <King of spades>
end define
define object <Ace of hearts>
end define
define object <2 of hearts>
end define
define object <3 of hearts>
end define
define object <4 of hearts>
end define
define object <5 of hearts>
end define
define object <6 of hearts>
end define
define object <7 of hearts>
end define
define object <8 of hearts>
end define
define object <9 of hearts>
end define
define object <10 of hearts>
end define
define object <Jack of hearts>
end define
define object <Queen of hearts>
end define
define object <King of hearts>
end define
define object <Ace of clubs>
end define
define object <2 of clubs>
end define
define object <3 of clubs>
end define
define object <4 of clubs>
end define
define object <5 of clubs>
end define
define object <6 of clubs>
end define
define object <7 of clubs>
end define
define object <8 of clubs>
end define
define object <9 of clubs>
end define
define object <10 of clubs>
end define
define object <Jack of clubs>
end define
define object <Queen of clubs>
end define
define object <King of clubs>
end define
define object <Ace of diamonds>
end define
define object <2 of diamonds>
end define
define object <3 of diamonds>
end define
define object <4 of diamonds>
end define
define object <5 of diamonds>
end define
define object <6 of diamonds>
end define
define object <7 of diamonds>
end define
define object <8 of diamonds>
end define
define object <9 of diamonds>
end define
define object <10 of diamonds>
end define
define object <Jack of diamonds>
end define
define object <Queen of diamonds>
end define
define object <King of diamonds>
end define
end define
define room <gameroom>
command <deal> do <dealing>
end define
define procedure <dealing>
if ( $rand(1;52)$ = 1 ) then give <Ace of spades>
if ( $rand(1;52)$ = 2 ) then give <2 of spades>
if ( $rand(1;52)$ = 3 ) then give <3 of spades>
if ( $rand(1;52)$ = 4 ) then give <4 of spades>
if ( $rand(1;52)$ = 5 ) then give <5 of spades>
if ( $rand(1;52)$ = 6 ) then give <6 of spades>
if ( $rand(1;52)$ = 7 ) then give <7 of spades>
if ( $rand(1;52)$ = 8 ) then give <8 of spades>
if ( $rand(1;52)$ = 9 ) then give <9 of spades>
if ( $rand(1;52)$ = 10 ) then give <10 of spades>
if ( $rand(1;52)$ = 11 ) then give <Jack of spades>
if ( $rand(1;52)$ = 12 ) then give <Queen of spades>
if ( $rand(1;52)$ = 13 ) then give <King of spades>
if ( $rand(1;52)$ = 14 ) then give <Ace of diamonds>
if ( $rand(1;52)$ = 15 ) then give <2 of diamonds>
if ( $rand(1;52)$ = 16 ) then give <3 of diamonds>
if ( $rand(1;52)$ = 17 ) then give <4 of diamonds>
if ( $rand(1;52)$ = 18 ) then give <5 of diamonds>
if ( $rand(1;52)$ = 19 ) then give <6 of diamonds>
if ( $rand(1;52)$ = 20 ) then give <7 of diamonds>
if ( $rand(1;52)$ = 21 ) then give <8 of diamonds>
if ( $rand(1;52)$ = 22 ) then give <9 of diamonds>
if ( $rand(1;52)$ = 23 ) then give <10 of diamonds>
if ( $rand(1;52)$ = 24 ) then give <Jack of diamonds>
if ( $rand(1;52)$ = 25 ) then give <Queen of diamonds>
if ( $rand(1;52)$ = 26 ) then give <King of diamonds>
if ( $rand(1;52)$ = 27 ) then give <Ace of hearts>
if ( $rand(1;52)$ = 28 ) then give <2 of hearts>
if ( $rand(1;52)$ = 29 ) then give <3 of hearts>
if ( $rand(1;52)$ = 30 ) then give <4 of hearts>
if ( $rand(1;52)$ = 31 ) then give <5 of hearts>
if ( $rand(1;52)$ = 32 ) then give <6 of hearts>
if ( $rand(1;52)$ = 33 ) then give <7 of hearts>
if ( $rand(1;52)$ = 34 ) then give <8 of hearts>
if ( $rand(1;52)$ = 35 ) then give <9 of hearts>
if ( $rand(1;52)$ = 36 ) then give <10 of hearts>
if ( $rand(1;52)$ = 37 ) then give <Jack of hearts>
if ( $rand(1;52)$ = 38 ) then give <Queen of hearts>
if ( $rand(1;52)$ = 39 ) then give <King of hearts>
if ( $rand(1;52)$ = 40 ) then give <Ace of clubs>
if ( $rand(1;52)$ = 41 ) then give <2 of clubs>
if ( $rand(1;52)$ = 42 ) then give <3 of clubs>
if ( $rand(1;52)$ = 43 ) then give <4 of clubs>
if ( $rand(1;52)$ = 44 ) then give <5 of clubs>
if ( $rand(1;52)$ = 45 ) then give <6 of clubs>
if ( $rand(1;52)$ = 46 ) then give <7 of clubs>
if ( $rand(1;52)$ = 47 ) then give <8 of clubs>
if ( $rand(1;52)$ = 48 ) then give <9 of clubs>
if ( $rand(1;52)$ = 49 ) then give <10 of clubs>
if ( $rand(1;52)$ = 50 ) then give <Jack of clubs>
if ( $rand(1;52)$ = 51 ) then give <Queen of clubs>
if ( $rand(1;52)$ = 52 ) then give <King of clubs>
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end define
Cryophile
20 Jun 2005, 18:56So theoretically you could receive unlimited aces of spades (or any card for that matter) by repeatedly typing deal? This is in response to francisstokes' example.
Also, nobody wants their inventory filled with a bunch of cards.
Also, nobody wants their inventory filled with a bunch of cards.
francisstokes
20 Jun 2005, 19:14Its a work in progress
.
You can only have 1 "ace of spades" because the card will just be moved from you inventory to your inventory.
Ill just make another procedure that checks if you have 7 (or any other x amount) cards.
But the point is, its only an engine, so the user of the engine has to design how many cards the player needs untill his/her hand is full.Im just laying out the pathway.

You can only have 1 "ace of spades" because the card will just be moved from you inventory to your inventory.
Ill just make another procedure that checks if you have 7 (or any other x amount) cards.
But the point is, its only an engine, so the user of the engine has to design how many cards the player needs untill his/her hand is full.Im just laying out the pathway.
steve the gaming guy
20 Jun 2005, 20:40I say good work and carry on. I tried it out and see some potential use for a deck of cards engine.
I think Im Dead
21 Jun 2005, 05:59Eh here's mine for the disection. Seems to work fine to me, though some of the commands aren't fleshed out too much. Questnet compatible.
define game <CardRoom>
asl-version <350>
gametype multiplayer
start <Lobby>
game author <tehjesus@gmail.com>
startscript for each object in <Deck01-Container> {
inc <Deck01-Count>
property <Deck01; %Deck01-Count%=#quest.thing#>
}
player startscript property <player%userid%; alias=$name(%userid%)$>
end define
define options
login off
register on
end define
define synonyms
end define
define room <Lobby>
command <shuffle #@object[userid]#> {
if got <#object[userid]#> then {
if action <#object[userid]#; shuffle> then {
set string <#object[userid]#-Input; player%userid%>
set string <#object[userid]#-Output; #quest.currentroom[userid]#>
doaction <#object[userid]#; shuffle>
}
else msgto <player%userid%; You cannot shuffle that.|n>
}
else msgto <player%userid%; You are not holding that.|n>
}
command <draw #@object[userid]#> {
if got <#object[userid]#> then {
if action <#object[userid]#; draw> then {
set string <#object[userid]#-Input; player%userid%>
set string <#object[userid]#-Output; #quest.currentroom[userid]#>
doaction <#object[userid]#; draw>
}
else msgto <player%userid%; You cannot draw from that.|n>
}
else msgto <player%userid%; You are not holding that.|n>
}
command <look #@object[userid]#> {
if here <#object[userid]#> then {
if action <#object[userid]#; look> then doaction <#object[userid]#; look> else msgto <player%userid%; You notice nothing out of the ordinary about it.|n>
}
else msgto <player%userid%; You cannot see that here.|n>
}
define object <Deck01>
alias <deck of cards>
alt <deck; dec; de; cards; card; car; ca>
take
prefix <a>
article <it>
properties <Count=52>
action <shuffle> {
set numeric <Deck01-Count; $objectproperty(Deck01; Count)$>
for <c; 1; %Deck01-Count%> {
set numeric <Deck01-ShufflePosition; $rand(%c%; %Deck01-Count%)$>
set string <Deck01-ShuffleA; $objectproperty(Deck01; %Deck01-ShufflePosition%)$>
set string <Deck01-ShuffleB; $objectproperty(Deck01; %c%)$>
property <Deck01; %c%=#Deck01-ShuffleA#>
property <Deck01; %Deck01-ShufflePosition%=#Deck01-ShuffleB#>
inc <c>
}
for each object in <#Deck01-Output#> if property <#quest.thing#; netplayer> then {
if ( #quest.thing# <> #Deck01-Input# ) then msgto <#quest.thing#; $displayname(#Deck01-Input#)$ shuffles a deck of cards.|n> else msgto <#quest.thing#; You shuffle the deck of cards.|n>
}
}
action <draw> {
set numeric <Deck01-Count; $objectproperty(Deck01; Count)$>
set string <Deck01-Draw; $objectproperty(Deck01; %Deck01-Count%)$>
move <#Deck01-Draw#; #Deck01-Input#>
property <Deck01; %Deck01-Count%=0>
dec <Deck01-Count>
property <Deck01; Count=%Deck01-Count%>
for each object in <#Deck01-Output#> if property <#quest.thing#; netplayer> then {
if ( #quest.thing# <> #Deck01-Input# ) then msgto <#quest.thing#; $displayname(#Deck01-Input#)$ draws a card from a deck of cards.|n> else msgto <#quest.thing#; You draw $displayname(#Deck01-Draw#)$ from the deck of cards.|n>
}
}
end define
end define
define room <Deck01-Container>
define object <d01>
alias <Ace of Diamonds>
alt <ace; ac>
take
prefix <an>
article <it>
end define
define object <d02>
alias <Two of Diamonds>
alt <two; tw>
take
prefix <a>
article <it>
end define
define object <d03>
alias <Three of Diamonds>
alt <three; thre; thr; th>
take
prefix <a>
article <it>
end define
define object <d04>
alias <Four of Diamonds>
alt <four; fou; fo>
take
prefix <a>
article <it>
end define
define object <d05>
alias <Five of Diamonds>
alt <five; fiv; fi>
take
prefix <a>
article <it>
end define
define object <d06>
alias <Six of Diamonds>
alt <six; si>
take
prefix <a>
article <it>
end define
define object <d07>
alias <Seven of Diamonds>
alt <seven; seve; sev; se>
take
prefix <a>
article <it>
end define
define object <d08>
alias <Eight of Diamonds>
alt <eight; eigh; eig; ei>
take
prefix <a>
article <it>
end define
define object <d09>
alias <Nine of Diamonds>
alt <nine; nin; ni>
take
prefix <a>
article <it>
end define
define object <d10>
alias <Ten of Diamonds>
alt <ten; te>
take
prefix <a>
article <it>
end define
define object <d11>
alias <Jack of Diamonds>
alt <jack; jac; ja>
take
prefix <a>
article <it>
end define
define object <d12>
alias <Queen of Diamonds>
alt <queen; quee; que; qu>
take
prefix <a>
article <it>
end define
define object <d13>
alias <King of Diamonds>
alt <king; kin; ki>
take
prefix <a>
article <it>
end define
define object <c01>
alias <Ace of Clubs>
alt <ace; ac>
take
prefix <an>
article <it>
end define
define object <c02>
alias <Two of Clubs>
alt <two; tw>
take
prefix <a>
article <it>
end define
define object <c03>
alias <Three of Clubs>
alt <three; thre; thr; th>
take
prefix <a>
article <it>
end define
define object <c04>
alias <Four of Clubs>
alt <four; fou; fo>
take
prefix <a>
article <it>
end define
define object <c05>
alias <Five of Clubs>
alt <five; fiv; fi>
take
prefix <a>
article <it>
end define
define object <c06>
alias <Six of Clubs>
alt <six; si>
take
prefix <a>
article <it>
end define
define object <c07>
alias <Seven of Clubs>
alt <seven; seve; sev; se>
take
prefix <a>
article <it>
end define
define object <c08>
alias <Eight of Clubs>
alt <eight; eigh; eig; ei>
take
prefix <a>
article <it>
end define
define object <c09>
alias <Nine of Clubs>
alt <nine; nin; ni>
take
prefix <a>
article <it>
end define
define object <c10>
alias <Ten of Clubs>
alt <ten; te>
take
prefix <a>
article <it>
end define
define object <c11>
alias <Jack of Clubs>
alt <jack; jac; ja>
take
prefix <a>
article <it>
end define
define object <c12>
alias <Queen of Clubs>
alt <queen; quee; que; qu>
take
prefix <a>
article <it>
end define
define object <c13>
alias <King of Clubs>
alt <king; kin; ki>
take
prefix <a>
article <it>
end define
define object <h01>
alias <Ace of Diamonds>
alt <ace; ac>
take
prefix <an>
article <it>
end define
define object <h02>
alias <Two of Hearts>
alt <two; tw>
take
prefix <a>
article <it>
end define
define object <h03>
alias <Three of Hearts>
alt <three; thre; thr; th>
take
prefix <a>
article <it>
end define
define object <h04>
alias <Four of Hearts>
alt <four; fou; fo>
take
prefix <a>
article <it>
end define
define object <h05>
alias <Five of Hearts>
alt <five; fiv; fi>
take
prefix <a>
article <it>
end define
define object <h06>
alias <Six of Hearts>
alt <six; si>
take
prefix <a>
article <it>
end define
define object <h07>
alias <Seven of Hearts>
alt <seven; seve; sev; se>
take
prefix <a>
article <it>
end define
define object <h08>
alias <Eight of Hearts>
alt <eight; eigh; eig; ei>
take
prefix <a>
article <it>
end define
define object <h09>
alias <Nine of Hearts>
alt <nine; nin; ni>
take
prefix <a>
article <it>
end define
define object <h10>
alias <Ten of Hearts>
alt <ten; te>
take
prefix <a>
article <it>
end define
define object <h11>
alias <Jack of Hearts>
alt <jack; jac; ja>
take
prefix <a>
article <it>
end define
define object <h12>
alias <Queen of Hearts>
alt <queen; quee; que; qu>
take
prefix <a>
article <it>
end define
define object <h13>
alias <King of Hearts>
alt <king; kin; ki>
take
prefix <a>
article <it>
end define
define object <s01>
alias <Ace of Spades>
alt <ace; ac>
take
prefix <an>
article <it>
end define
define object <s02>
alias <Two of Spades>
alt <two; tw>
take
prefix <a>
article <it>
end define
define object <s03>
alias <Three of Spades>
alt <three; thre; thr; th>
take
prefix <a>
article <it>
end define
define object <s04>
alias <Four of Spades>
alt <four; fou; fo>
take
prefix <a>
article <it>
end define
define object <s05>
alias <Five of Spades>
alt <five; fiv; fi>
take
prefix <a>
article <it>
end define
define object <s06>
alias <Six of Spades>
alt <six; si>
take
prefix <a>
article <it>
end define
define object <s07>
alias <Seven of Spades>
alt <seven; seve; sev; se>
take
prefix <a>
article <it>
end define
define object <s08>
alias <Eight of Spades>
alt <eight; eigh; eig; ei>
take
prefix <a>
article <it>
end define
define object <s09>
alias <Nine of Spades>
alt <nine; nin; ni>
take
prefix <a>
article <it>
end define
define object <s10>
alias <Ten of Spades>
alt <ten; te>
take
prefix <a>
article <it>
end define
define object <s11>
alias <Jack of Spades>
alt <jack; jac; ja>
take
prefix <a>
article <it>
end define
define object <s12>
alias <Queen of Spades>
alt <queen; quee; que; qu>
take
prefix <a>
article <it>
end define
define object <s13>
alias <King of Spades>
alt <king; kin; ki>
take
prefix <a>
article <it>
end define
end define
paul_one
21 Jun 2005, 09:38I'd say it needs a little bit of work ITID. But 'it works'.
The shuffle action has my mind spinning - either that or the lack of food or poor air quality or chewing gum I'm 'chewing'.
Francis - the whole point of making an "engine" is that they don't need to know how it works, or indeed have to change it (can you imagine normal people buying a car and EXPECTING to open the bonnet to get it working?). They should change THEIR code to refine it, but the 'engine' has all the 'general' actions that you would expect. Those actions should be able to be specific enough to use very simply - or generic enough to be used in a wide variety of applications.
The shuffle action has my mind spinning - either that or the lack of food or poor air quality or chewing gum I'm 'chewing'.
Francis - the whole point of making an "engine" is that they don't need to know how it works, or indeed have to change it (can you imagine normal people buying a car and EXPECTING to open the bonnet to get it working?). They should change THEIR code to refine it, but the 'engine' has all the 'general' actions that you would expect. Those actions should be able to be specific enough to use very simply - or generic enough to be used in a wide variety of applications.
I think Im Dead
21 Jun 2005, 14:01Yeah, just looking over it I can see I have atleast one too many random numbers in that action. I'm not too worried about it, because 'it works', and it was just an example I wrote a few days ago for when the thread started. I was probably all messed up at the time anyways. I suppose if you were to ignore the random number brought by %c% and the %Deck01-Count% and just go through the total number of cards 1 by 1, and switch them with another random cards position it would kinda simulate shuffling a bit more accurately, well atleast when you do the 'bridge' type shuffling.
But you can't draw the same card more than once, and it's a a truly random shuffle, so I win.
But you can't draw the same card more than once, and it's a a truly random shuffle, so I win.
francisstokes
21 Jun 2005, 15:49I know its bad.I need to re-do the whole thing really, but im optimistic
.
Im sure i can get it to work if i keep at it.
At the moment im trying to work out how to stop the player getting a card once they have x amount of card (something that the user would HAVE to change on thier own).

Im sure i can get it to work if i keep at it.
At the moment im trying to work out how to stop the player getting a card once they have x amount of card (something that the user would HAVE to change on thier own).