play and relax: games for kids games
  Cut the knot: learn to enjoy mathematics
A math books store at a unique math study site. Learn to enjoy mathematics.
Google
Web CTK
Best sites for teachers
Sites for teachers
Sites for parents
Terms of use
Awards

Interactive Activities
CTK Exchange
CTK Insights - a blog

Games & Puzzles
What Is What
Arithmetic/Algebra
Geometry
Probability
Outline Mathematics
Make an Identity
Book Reviews
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
Visual Illusions
My Logo
Math Poll
Cut The Knot!
MSET99 Talk
Other Math sites
Front Page
Movie shortcuts
Personal info
Privacy Policy

Guest book
News sites

Recommend this site

Best sites for teachers
Sites for teachers
Sites for parents

Education & Parenting

Manifesto: what CTK is about Search CTK Buying a book is a commitment to learning Table of content Things you can find on CTK Chronology of updates Email to Cut The Knot Recommend this page

Subject: Advice on Nim
Date: Wed, 26 Nov 1997 00:53:30 -0500
From: Tom Utley

I have been assigned a project in computer science class to develop a class in C++ which will play against another class in the game of NIM. I used your theory to do so. However, when I recieved the referee program to test the files, I noticed a small problem: the object of the NIM that the professor was talking about is to NOT take the last stick. Could you please take a look at my strategy and suggest a way to keep it similar, but change it so that it is the opposite? I have looked over it time and time again, but I just can't figure out the way to invert the strategy. The file is tutley.cpp, method implementation from tutley.h; the referee.cpp is the file that runs the game.

Thank you for your help.

 

 

Copyright © 1996-2008 Alexander Bogomolny

29397664Page copy protected against web site content infringement by Copyscape


Search:
Keywords:


Latest on CTK Exchange
try this puzzle ?/?? + ?/?? + ?/? ...
Posted by albert1950
0 messages
07:05 AM, Jul-10-08

Monty Hall Problem
Posted by linkdon
71 messages
03:06 PM, Jul-18-08

Missing information
Posted by roboknight
2 messages
07:32 AM, Jun-22-08

Golden Number linked to 666
Posted by Titus
4 messages
02:53 PM, Jul-19-08

Mistake on the page (an aside, Be ...
Posted by Max
4 messages
10:28 AM, Feb-28-08

trisection of an angle
Posted by Pytheus
2 messages
06:39 AM, Jul-14-08

You can drill a square hole
Posted by Giorgis
1 messages
10:15 PM, Jul-12-08