Go Fish/Unicon: Difference between revisions
m
Fixed syntax highlighting.
m (removed icon+unicon header (double counting)) |
m (Fixed syntax highlighting.) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 17:
* (iii) Guess. This should also be in inverse proportion to what you hold in your hand.
<syntaxhighlight lang="icon">
link printf,strings
Line 56:
if *opponent.hand = 0 then DrawCard(opponent)# hand empty ?
ifbook(player) # made a book ?
}
else {
printf("No, %s has no %s's -
DrawCard(player) # draw from deck
ifbook(player) # made a book ?
Line 129:
printf("You: Does the computer have any %s's?\n",r)
return r
end</
{{libheader|Icon Programming Library}}
Line 137:
Sample Game:<pre>Go fish.
You vs. the computer - your turn first:
Your hand :
Your turn :
You: Does the computer have any
Yes, there was
Your hand :
Your turn :
You: Does the computer have any
Yes, there was
Your hand :
Your turn : a
You: Does the computer have any A's?
No, Computer has no A's - Human draws a card
Computer: Do you have any 3's?
Yes, there was 1 3('s)
Computer: Do you have any 5's?
No, Human has no 5's - Computer draws a card
Your hand : 4688AAJJKKKQ
Your turn : 4
You: Does the computer have any 4's?
Yes, there was 2 4('s)
Your hand : 444688AAJJKKKQ
Your turn : 6
You: Does the computer have any 6's?
Yes, there was 2 6('s)
Your hand :
Your turn : 8
You: Does the computer have any 8's?
No, Computer has no 8's - Human draws a card
Computer: Do you have any 3's?
No, Human has no 3's - Computer draws a card
Your hand : 44466688AAJJKKKQQ
Your turn : q
You: Does the computer have any Q's?
No, Computer has no Q's -
Computer: Do you have any
No, Human has no 3's - Computer draws a card
Your hand : 444666888AAJJKKKQQ
Your turn : k
You: Does the computer have any K's?
No, Computer has no K's - Human draws a card
Computer: Do you have any 3's?
No, Human has no 3's - Computer draws a card
Your hand : 444666888AAJJKKKQQT
Your turn : t
You: Does the computer have any T's?
Yes, there was 1 T('s)
Your hand : 444666888AAJJKKKQQTT
Your turn : j
You: Does the computer have any J's?
No, Computer has no J's - Human draws a card
Computer: Do you have any 2's?
No, Human has no 2's - Computer draws a card
Your hand : 444666888AAAJJKKKQQTT
Your turn : a
You: Does the computer have any A's?
No, Computer has no A's - Human draws a card
Computer: Do you have any J's?
Yes, there was
Computer: Do you have any 7's?
No, Human has no 7's -
Your hand :
Your turn : 4
You: Does the computer have any 4's?
Yes, there was
Human made a book of 4's
Your hand :
Your turn : 6
You: Does the computer have any 6's?
No, Computer has no 6's -
Computer: Do you have any 5's?
No, Human has no 5's - Computer draws a card
Your hand : 23666888AAAKKKQQTT
Your turn : 8
You: Does the computer have any 8's?
No, Computer has no 8's - Human draws a card
Computer: Do you have any 2's?
Yes, there was 1 2('s)
Computer: Do you have any 3's?
Yes, there was 1 3('s)
No, Human has no 7's - Computer draws a card
Your
Your turn : t
You: Does the computer have any T's?
No, Computer has no T's - Human draws a card
Human made a book of 6's
Computer: Do you have any 7's?
No, Human has no 7's - Computer draws a card
Your hand : 888AAAJKKKQQTT
Your turn : q
You: Does the computer have any Q's?
No, Computer has no Q's - Human draws a card
Computer: Do you have any 8's?
Computer made a book of 8's
Computer: Do you have any J's?
Yes, there was 1 J('s)
Computer made a book of J's
Computer: Do you have any 9's?
No, Human has no 9's - Computer draws a card
Your hand : 5AAAKKKQQTT
Your turn : a
You: Does the computer have any A's?
No, Computer has no A's -
Yes, there was 1 7('s)
Computer: Do you have any 9's?
No, Human has no 9's - Computer draws a card
Your hand : 5AAAKKKQQTT
Your turn : k
You: Does the computer have any K's?
No, Computer has no K's - Human draws a card
Computer: Do you have any T's?
Yes, there was 2 T('s)
Computer: Do you have any
Yes, there was 1 9('s)
Computer: Do you have any 2's?
No, Human has no 2's - Computer draws a card
Your hand : 5AAAKKKQQ
Your turn : 5
Yes, there was
Your hand : 555AAAKKKQQ
Your turn : q
You: Does the computer have any Q's?
Yes, there was 1 Q('s)
Your
Your turn : k
You: Does the computer have any K's?
No, Computer has no K's - Human draws a card
Computer: Do you have any 2's?
No, Human has no 2's - Computer draws a card
Your hand : 555AAAKKKQQQT
Your turn : t
You: Does the computer have any T's?
Yes, there was 3 T('s)
Human made a book of T's
Your hand : 555AAAKKKQQQ
Your turn : 5
You: Does the computer have any 5's?
No, Computer has no 5's - Human draws a card
Computer: Do you have any Q's?
Yes, there was 3 Q('s)
Computer made a book of Q's
Computer: Do you have any 7's?
No, Human has no 7's - Computer draws a card
Your hand : 2555AAAKKK
Your turn : 2
You: Does the computer have any 2's?
Yes, there was 3 2('s)
Human made a book of 2's
Your hand :
Your turn :
You: Does the computer have any
No, Computer has no 5's - Human draws a card
Yes, there was 3 A('s)
Computer made a book of A's
No,
Your hand : 3555KKK
Your turn : 3
You: Does the computer have any 3's?
Yes, there was 3 3('s)
Human made a book of 3's
Your hand : 555KKK
Your turn : k
You: Does the computer have any K's?
No, Computer has no K's - Human draws a card
Human made a book of 5's
Computer: Do you have any 7's?
No, Human has no 7's - Computer draws a card
Computer made a book of 9's
Your hand : KKK
Your turn : k
You: Does the computer have any K's?
No, Computer has no K's - Human draws a card
Human made a book of K's
Computer: Do you have any 7's?
Yes, there was 1 7('s)
Computer made a book of 7's
Final score: Computer=6, Human=7 - Human wins.</pre>
|