whee "turing completness"

Everything todo with programming goes HERE.

Should we force luke-jr to say something nice?

yes
10
91%
no
1
9%
 
Total votes: 11

User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

An easy feature to add would be to support an arbitrary number of players and matches.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Who wins?
ˌɑrməˈɡɛˌtrɑn
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

Jonathan wrote:Who wins?
The person who picks up the last match (opposite of original rules)

Here (with AI bug)
User avatar
Lucifer
Project Developer
Posts: 8641
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

No, actually the winner is determined by the original rules. Run it and see. :)
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

Lucifer wrote:No, actually the winner is determined by the original rules. Run it and see. :)

Code: Select all

$ ruby match_game.rb --players=0 --ai=3 --matches=10
10 matches remain. How many do you want to take, AI_1? 3
7 matches remain. How many do you want to take, AI_2? 3
4 matches remain. How many do you want to take, AI_3? 3
1 matches remain. How many do you want to take, AI_1? 1
AI_1 is the winner! Well done.

$ ruby match_game.rb --players=0 --ai=2 --matches=10
10 matches remain. How many do you want to take, AI_1? 1
9 matches remain. How many do you want to take, AI_2? 3
6 matches remain. How many do you want to take, AI_1? 3
3 matches remain. How many do you want to take, AI_2? 2
(text omitted: AI_1 picks up last match)
AI_2 is the winner! Well done.
User avatar
Lucifer
Project Developer
Posts: 8641
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Oops. I misunderstood. Yeah, you're right, for more than one player you want to go opposite the original rules.

Or you could do it by elimination. Each round eliminates one player until there is only one left, and he's the winner.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

I have no chance against the AI.

Code: Select all

Enter Player 1's name: Jonathan
400 matches remain. How many do you want to take, Jonathan? 100
You can not take that many matches, Jonathan!
400 matches remain. How many do you want to take, Jonathan? 4
You can not take that many matches, Jonathan!
400 matches remain. How many do you want to take, Jonathan? 3
397 matches remain. How many do you want to take, AI_1? 3
394 matches remain. How many do you want to take, AI_2? 3
391 matches remain. How many do you want to take, AI_3? 3
388 matches remain. How many do you want to take, AI_4? 3
385 matches remain. How many do you want to take, AI_5? 3
382 matches remain. How many do you want to take, AI_6? 3
379 matches remain. How many do you want to take, AI_7? 3
376 matches remain. How many do you want to take, AI_8? 3
373 matches remain. How many do you want to take, AI_9? 3
370 matches remain. How many do you want to take, AI_10? 3
367 matches remain. How many do you want to take, AI_11? 3
364 matches remain. How many do you want to take, AI_12? 3
361 matches remain. How many do you want to take, AI_13? 3
358 matches remain. How many do you want to take, AI_14? 3
355 matches remain. How many do you want to take, AI_15? 3
352 matches remain. How many do you want to take, AI_16? 3
349 matches remain. How many do you want to take, AI_17? 3
346 matches remain. How many do you want to take, AI_18? 3
343 matches remain. How many do you want to take, AI_19? 3
340 matches remain. How many do you want to take, AI_20? 3
337 matches remain. How many do you want to take, Jonathan? 3
334 matches remain. How many do you want to take, AI_1? 3
331 matches remain. How many do you want to take, AI_2? 3
328 matches remain. How many do you want to take, AI_3? 3
325 matches remain. How many do you want to take, AI_4? 3
322 matches remain. How many do you want to take, AI_5? 3
319 matches remain. How many do you want to take, AI_6? 3
316 matches remain. How many do you want to take, AI_7? 3
313 matches remain. How many do you want to take, AI_8? 3
310 matches remain. How many do you want to take, AI_9? 3
307 matches remain. How many do you want to take, AI_10? 3
304 matches remain. How many do you want to take, AI_11? 3
301 matches remain. How many do you want to take, AI_12? 3
298 matches remain. How many do you want to take, AI_13? 3
295 matches remain. How many do you want to take, AI_14? 3
292 matches remain. How many do you want to take, AI_15? 3
289 matches remain. How many do you want to take, AI_16? 3
286 matches remain. How many do you want to take, AI_17? 3
283 matches remain. How many do you want to take, AI_18? 3
280 matches remain. How many do you want to take, AI_19? 3
277 matches remain. How many do you want to take, AI_20? 3
274 matches remain. How many do you want to take, Jonathan? 3
271 matches remain. How many do you want to take, AI_1? 3
268 matches remain. How many do you want to take, AI_2? 3
265 matches remain. How many do you want to take, AI_3? 3
262 matches remain. How many do you want to take, AI_4? 3
259 matches remain. How many do you want to take, AI_5? 3
256 matches remain. How many do you want to take, AI_6? 3
253 matches remain. How many do you want to take, AI_7? 3
250 matches remain. How many do you want to take, AI_8? 3
247 matches remain. How many do you want to take, AI_9? 3
244 matches remain. How many do you want to take, AI_10? 3
241 matches remain. How many do you want to take, AI_11? 3
238 matches remain. How many do you want to take, AI_12? 3
235 matches remain. How many do you want to take, AI_13? 3
232 matches remain. How many do you want to take, AI_14? 3
229 matches remain. How many do you want to take, AI_15? 3
226 matches remain. How many do you want to take, AI_16? 3
223 matches remain. How many do you want to take, AI_17? 3
220 matches remain. How many do you want to take, AI_18? 3
217 matches remain. How many do you want to take, AI_19? 3
214 matches remain. How many do you want to take, AI_20? 3
211 matches remain. How many do you want to take, Jonathan? 3
208 matches remain. How many do you want to take, AI_1? 3
205 matches remain. How many do you want to take, AI_2? 3
202 matches remain. How many do you want to take, AI_3? 3
199 matches remain. How many do you want to take, AI_4? 3
196 matches remain. How many do you want to take, AI_5? 3
193 matches remain. How many do you want to take, AI_6? 3
190 matches remain. How many do you want to take, AI_7? 3
187 matches remain. How many do you want to take, AI_8? 3
184 matches remain. How many do you want to take, AI_9? 3
181 matches remain. How many do you want to take, AI_10? 3
178 matches remain. How many do you want to take, AI_11? 3
175 matches remain. How many do you want to take, AI_12? 3
172 matches remain. How many do you want to take, AI_13? 3
169 matches remain. How many do you want to take, AI_14? 3
166 matches remain. How many do you want to take, AI_15? 3
163 matches remain. How many do you want to take, AI_16? 3
160 matches remain. How many do you want to take, AI_17? 3
157 matches remain. How many do you want to take, AI_18? 3
154 matches remain. How many do you want to take, AI_19? 3
151 matches remain. How many do you want to take, AI_20? 3
148 matches remain. How many do you want to take, Jonathan? 3
145 matches remain. How many do you want to take, AI_1? 3
142 matches remain. How many do you want to take, AI_2? 3
139 matches remain. How many do you want to take, AI_3? 3
136 matches remain. How many do you want to take, AI_4? 3
133 matches remain. How many do you want to take, AI_5? 3
130 matches remain. How many do you want to take, AI_6? 3
127 matches remain. How many do you want to take, AI_7? 3
124 matches remain. How many do you want to take, AI_8? 3
121 matches remain. How many do you want to take, AI_9? 3
118 matches remain. How many do you want to take, AI_10? 3
115 matches remain. How many do you want to take, AI_11? 3
112 matches remain. How many do you want to take, AI_12? 3
109 matches remain. How many do you want to take, AI_13? 3
106 matches remain. How many do you want to take, AI_14? 3
103 matches remain. How many do you want to take, AI_15? 3
100 matches remain. How many do you want to take, AI_16? 3
97 matches remain. How many do you want to take, AI_17? 3
94 matches remain. How many do you want to take, AI_18? 3
91 matches remain. How many do you want to take, AI_19? 3
88 matches remain. How many do you want to take, AI_20? 3
85 matches remain. How many do you want to take, Jonathan? 3
82 matches remain. How many do you want to take, AI_1? 3
79 matches remain. How many do you want to take, AI_2? 3
76 matches remain. How many do you want to take, AI_3? 3
73 matches remain. How many do you want to take, AI_4? 3
70 matches remain. How many do you want to take, AI_5? 3
67 matches remain. How many do you want to take, AI_6? 3
64 matches remain. How many do you want to take, AI_7? 3
61 matches remain. How many do you want to take, AI_8? 3
58 matches remain. How many do you want to take, AI_9? 3
55 matches remain. How many do you want to take, AI_10? 3
52 matches remain. How many do you want to take, AI_11? 3
49 matches remain. How many do you want to take, AI_12? 3
46 matches remain. How many do you want to take, AI_13? 3
43 matches remain. How many do you want to take, AI_14? 3
40 matches remain. How many do you want to take, AI_15? 3
37 matches remain. How many do you want to take, AI_16? 3
34 matches remain. How many do you want to take, AI_17? 3
31 matches remain. How many do you want to take, AI_18? 3
28 matches remain. How many do you want to take, AI_19? 3
25 matches remain. How many do you want to take, AI_20? 3
22 matches remain. How many do you want to take, Jonathan? 3
19 matches remain. How many do you want to take, AI_1? 3
16 matches remain. How many do you want to take, AI_2? 3
13 matches remain. How many do you want to take, AI_3? 3
10 matches remain. How many do you want to take, AI_4? 3
7 matches remain. How many do you want to take, AI_5? 3
4 matches remain. How many do you want to take, AI_6? 3
1 matches remain. How many do you want to take, AI_7? 1
AI_7 is the winner! Well done.
:)
ˌɑrməˈɡɛˌtrɑn
User avatar
TiTnAsS
Match Winner
Posts: 655
Joined: Sun Jan 23, 2005 2:44 am
Location: Reppin the Bay Area!

Post by TiTnAsS »

z-man wrote:Applause! It works fine, and it's even good style. A minor glitch (minor because it does not lead to undesired behavior): it does not check anymore whether you took more matches than are there:

Code: Select all

...
It's blubb's turn.
There are 2 matches left.
How many matches do you want to take? 3
bla is the winner!
Because thats the same as hitting 0...

How did you add AI jonathon?
Damn, it sure has been a while!
Post Reply