Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have buit a snake game, but i was told to make the game for children in order for them to eat selected numbers to get a random sum given.

What I have tried:

I only buit a snake game that eats just one food.
Posted
Updated 21-May-18 10:54am
Comments
Patrice T 21-May-18 15:44pm    
We can't help you, we have no idea how you did the first food and why it is a problem to have more food.
CPallini 22-May-18 2:59am    
How can we possibly guess? Show us the code, please.

1 solution

Here is a solution in cutting edge C++: The Insider News[^]
C++
class snakeGameWithMultipleFoods {
   var whateverIsNeeded;
   var whateverElseIsNeeded;
   //...

   auto doSomething() {
      //...
      return something;
      }

   auto doSomethingElse() {
      //...
      return somethingElse;
      }

   }

All good. Have a great day!
 
Share this answer
 
Comments
CPallini 22-May-18 2:58am    
Nope, that's not C++. ;P
David O'Neil 22-May-18 9:44am    
You're right! I forgot to capitalize my object name! :)

Unfortunately the above is probably the path this unPadawan will follow (if he makes it). Maybe I'm wrong, though. And he learns to craft good questions after trying things out for himself (or herself). Should have just told him to turn it in as-is! ;P

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900