A game like "simon"

Can someone help me? I need to make a program that simulates the game "Simon", but in a simpler way ... Instead of colors, the display should show numbers from 0 to 9 ... for example:
The number 5 appears on the screen and after a few seconds, disappears. The player clicks on the key 5. The number 5 and the number 9 on the screen and after a few seconds, disappear. The player clicks on the key 5 then the key 9....
At first, the game needs to ask the name of the two players. the player who makes the longest streak wins. In the end, the winner's name should appear with your score.
Sorry for my bad english, i'm from Brazil and i don't speak very well... hope you understand! Thanks ...

Respuestas (2)

Simon
Simon el 6 de Dic. de 2013

0 votos

Hi!
Some hints to get you started:
  • You can get the player's name using "input".
  • Make a loop from 1 to, let's say, 1000.
  • In every loop iteration show the user the current count of number (randomly generated)
  • Make a pause
  • Clear the screen
  • Ask the user for the numbers
  • Compare the numbers
  • If it's correct: next loop iteration
  • If not: break out of the loop and store the loop counter-1 as score
Start with that. If you have a small program and you have specific questions, post your code and ask!

4 comentarios

Leonardo
Leonardo el 6 de Dic. de 2013
Editada: Leonardo el 6 de Dic. de 2013
Thank you. The tips helped a lot. I started doing!
  • jogadorA = input ('Qual é o nome do jogador A? ')
  • jogadorB = input ('Qual é o nome do jogador B? ')
  • for contador = 1:1:1000
I had a problem now. How can I generate random integer numbers 0-9?
I think I can do the rest!
Sean de Wolski
Sean de Wolski el 6 de Dic. de 2013
doc randi
Leonardo
Leonardo el 6 de Dic. de 2013
I just found out. If I have any questions, i'll be back here!
SAI HARSHA SUNKARA
SAI HARSHA SUNKARA el 8 de Mzo. de 2021
send me the code if you have done it

Iniciar sesión para comentar.

Leonardo
Leonardo el 6 de Dic. de 2013

0 votos

Well, it's more complicated than I thought. I will not be able to do that until midnight, cause I'll be working. So if someone can make this game for me, I would be very, very, very grateful. Thank you all...

3 comentarios

Image Analyst
Image Analyst el 6 de Dic. de 2013
Maybe you would be grateful, but I thought you were doing it for fun, not just because it's something you had to have for some reason. Where's the fun and pride in creating the game if you just run code someone else gave you?
Perfect Obumneme
Perfect Obumneme el 7 de Abr. de 2018
lmao :):):)thats deep!!

Iniciar sesión para comentar.

Categorías

Más información sobre Board games en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 6 de Dic. de 2013

Comentada:

el 8 de Mzo. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by