|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
[Spades] The hex (lookalike) values table
Is it really supposed to be that messy, or did someone forget to have their beauty sleep?
(The nrs are very wierd, like 1-2-3-4-6 etc. I can understand that it jumps from 0, 16, 32, 48 etc.) -TheRat |
|
#2
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
Found my answer in another post...
Well, my player is done (v1 atleast).. Seems I gotta write myself a judge to test it :p But I really dont have anything to compare it to tho, which is a bit of a problem :p -TheRat |
|
#3
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
The values are that way for simple bit-math stuffs..
$suit = $value >> 4; $rank = $value & 16 |
|
#4
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
actually,
$rank = $value & 15 |
|
#5
|
||||
|
||||
|
[Spades] RE: The hex (lookalike) values table
what does the >> operator do? Why are the hex codes being mentioned on the chart when the script is passing integers?
|
|
#6
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
>> is a shift right operator, meaning it shifts the bits of a number bits. Each shift is equal to (integer) division by 2. So, 16>>2 is 4, and 256>>5 is 8. The hex codes are being mentioned so you can see the pattern. It was designed this way so that comparing ranks and/or suits is easy.
|
|
#7
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
er ya sorry.. my mistake!
I caught it though when I wrote the judging script. Is that sub-contest still on? |
|
#8
|
||||
|
||||
|
[Spades] RE: The hex (lookalike) values table
I understood the comparison but I guess since it's spades and not a bidding for trump game like bridge I didn't see the benefit of comparing suits and I've never used the shift right operator.
I have another question: are you going to pass the score to the scripts at anytime? If you play first on the last trick your script will currently not be aware of whether it made it's bid in some cases and without knowing the game situation it makes very little sense to go blindnil. |
|
#9
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
I can't believe I forgot that ...
Yeah, I'll make an official update to parameters to include scoring information... |
|
#10
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
Ey! I made a workaround, using mydata etc, and NOW you tell me! How rude :p
-TheRat |
|
#11
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
Oh, mybad.. I confused score with ticks :p
|
|
#12
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
I was just about to post and complain that my scripts were confused about the current score, which made them act oddly
|
|
#13
|
||||
|
||||
|
[Spades] RE: The hex (lookalike) values table
you can determine score from tricks but not if you don't know who won the last trick which will happen alot even if you know what cards are left you can't always be sure who played them.
|
|
#14
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
There's also the problem of incomplete games. A match between two players will probably not end at the same time as a game. (Here "game" is being used to mean "that which starts over every time one team gets to 500 or -200". What the contest rules refer to as a "game" I usually call a "hand".) The information given to the script doesn't give it any way to know when a new game starts, which is of course important for strategy.
In any case, I suggest the following structure for a score parameter: Which on the query string looks like 'score=125,3,236,5'. This is how I'll implement my judge script until the official spec gets posted. |
|
#15
|
|||
|
|||
|
[Spades] RE: The hex (lookalike) values table
I thought your bag count is simply score%10 (the units digit basically)... Admittedly, it's possible to go over by 11 when you had 9 bags before a hand, but that's very unlikely.
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [Spades] The hex (lookalike) values table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|