i need to write code for external game of life (player vs computer).
anyone have full code for normal game of life or sth like that?
thanks
i need to write code for external game of life (player vs computer).
anyone have full code for normal game of life or sth like that?
thanks
1. the game of life is normally a computer simulation. What does it mean to have player vs. computer.
2. I'm sure google can find many source code examples you can cheat from.
3. Try doing some work for yourself. If you're aspiring to a career as a software developer, you need to pull your finger out.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
This is a strange question.
What is an "external" game of life?
How can a player play against the computer?
What does it mean???
I had started to write the code, but i need an idea for generations. Thanks for help.
We got a exersice to build the game with new conditions.
Since you seem unable or unwilling to explain those "new conditions", why not give us a link to your assignment?
I'm curious.
the rule of my excersice is not by english.
but i can arite in short (my english is bad):
a. the user choose the number of living cells, and he choose the color- red(for player), green (for computer).
b. first generation. normal rules, but if dead cell have a 3 neighbers, he will wake up with the most common color of his neighber (2 red,1 green- red, 2 green 1 red- green etc).
c genertion go ahead.
d. user choose dead cell to get alive. one turn for him, one for computer.
etc
Your English is actually pretty good!
I am beginning to understand your program.
I have some questions.
The user chooses the number of living cells.a. the user choose the number of living cells, and he choose the color- red(for player), green (for computer).
Does he also choose the cell positions or are they chosen randomly?
Parts b and c happen automatically, right?b. first generation. normal rules, but if dead cell have a 3 neighbors, he will wake up with the most common color of his neighbor (2 red,1 green- red, 2 green 1 red- green etc).
c. generation go ahead.
At this point the user chooses a dead cell to turn into a living cell, and the computer does the same (presumably randomly).d. user choose dead cell to get alive. one turn for him, one for computer.
How are you going to display the board? You talk about red and green, so apparently it's not a console program.
Also, where exactly are you stuck?
> so apparently it's not a console program.
It could be, as it might have the variables to represent each color which is then coordinated to that particular cell.
Of course this is pure speculation. Doing this sort of thing GUI based however would ideally be presented in a better format than console.Code:char red = 'R', green = 'G';
Double Helix STL
The user also choose the position. About b-d, yes, and green is g and red is r.
Also, the player choose the nunber of generations. After all generations, the winner is who has more living cells than other. (or if all living cells died in middle of game, the game is over and no one win)
Later ill got my pc, than i show you example output