Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Loop a menu

Subject: Loop a menu

From: Caitlynn Roy

Date: 29 Oct, 2012 20:11:08

Message: 1 of 2

I am creating a game program and I need to figure out how to loop a menu.
(The game is Chain Reaction)

For example:

While my game runs it will use the menu below:

word=menu('Which would you like?','Coffee','_ _ _', '_ _ _ _', '_ _ _', '_ _ _ _ _', '_ _ _ _', '_ _ _ _ _ _','Pump');

For each case the user must guess the word. Once they guess the correct answer the menu will reappear and they can chose which word they would like to guess next.

How can I have the menu display the answers they have already guessed correctly through each loop?

Subject: Loop a menu

From: Kristin

Date: 30 Oct, 2012 14:05:08

Message: 2 of 2

"Caitlynn Roy" wrote in message <k6mnss$5qv$1@newscl01ah.mathworks.com>...
> I am creating a game program and I need to figure out how to loop a menu.
> (The game is Chain Reaction)
>
> For example:
>
> While my game runs it will use the menu below:
>
> word=menu('Which would you like?','Coffee','_ _ _', '_ _ _ _', '_ _ _', '_ _ _ _ _', '_ _ _ _', '_ _ _ _ _ _','Pump');
>
> For each case the user must guess the word. Once they guess the correct answer the menu will reappear and they can chose which word they would like to guess next.
>
> How can I have the menu display the answers they have already guessed correctly through each loop?

Each time a select is made, you can compare strings for correct answers and then update a text box below or off to the side (whatever) with these answers. Make it so that the text box is not editable by the user.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us