Re: [Tutor] The game of nim in python

2016-04-22 Thread Danny Yoo
On Fri, Apr 22, 2016 at 5:45 AM, Henderson, Kevin (GE Aviation, US) wrote: > Python to Jython. > > Can you help me with a Jython code for the Nim game? If you can say more about what you're like help with, we can tailor advice toward what you want. I'll treat this as a quick-and-dirty design rev

Re: [Tutor] The game of nim in python

2016-04-22 Thread Michael Selik
What's the problem you're trying to solve? Did you get an error? Here's a quick revision. There's probably a more elegant way, but this seems to work. #/usr/bin/env python from __future__ import print_function import random try: input = raw_input except NameError:

Re: [Tutor] The game of nim in python

2016-04-22 Thread Alan Gauld via Tutor
On 22/04/16 13:45, Henderson, Kevin (GE Aviation, US) wrote: > Python to Jython. > > Can you help me with a Jython code for the Nim game? > There shouldn't be much difference between a Jython or Python implementation - unless you are building a GUI of course! > Removing 1-4 sticks out of 13, la

Re: [Tutor] The game of nim in python

2016-04-22 Thread Henderson, Kevin (GE Aviation, US)
Python to Jython. Can you help me with a Jython code for the Nim game? Removing 1-4 sticks out of 13, last player who picks up the last stick wins Player 1 vs player2(Computer) player1=str(input("Enter your name. ")) player2="Computer" howMany=0 gameover=False strawsNumber=random.randint(10,20)

Re: [Tutor] The game of nim in python

2013-04-04 Thread Dave Angel
On 03/27/2013 08:30 AM, Yasin El Guennouni wrote: Hello, I am trying to modify a game of nim code. The game in the code works as: "You need to remove from 1 to 3 straws from the pile. The player that removes the final straw is the loser." But I would like it to be like the classic game, where

[Tutor] The game of nim in python

2013-04-04 Thread Yasin El Guennouni
Hello, I am trying to modify a game of nim code. The game in the code works as: "You need to remove from 1 to 3 straws from the pile. The player that removes the final straw is the loser." But I would like it to be like the classic game, where you have 4 piles containing 1,3,5 and 7 sticks whe