Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing Help (urgent)
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MikeAlexnder




PostPosted: Tue Dec 23, 2008 1:18 pm   Post subject: Turing Help (urgent)

How do I create menus and submenus so when the user is in a submenu they can go back to the main menu if they want?
Sponsor
Sponsor
Sponsor
sponsor
MikeAlexnder




PostPosted: Tue Dec 23, 2008 1:19 pm   Post subject: RE:Turing Help (urgent)

PLEASE HELP ME!
MikeAlexnder




PostPosted: Tue Dec 23, 2008 1:22 pm   Post subject: RE:Turing Help (urgent)

My code is like this right now:
Turing:
put "dssdsdsds"
put "1=3443434"
put "2=dsadasdas"
var option: int
get option
case option of
label 1 : put "dsadasdas"
            var option2:int
             get option2
             case option2 of
          label 1:32323232
          label 2: 4343434343
label 2: put fdsfsfsdfsd


Mod Edit: Remember to use syntax tags! Thanks Smile
code:
[syntax="turing"]Code Here[/syntax]
OneOffDriveByPoster




PostPosted: Tue Dec 23, 2008 1:42 pm   Post subject: Re: Turing Help (urgent)

MikeAlexnder @ Tue Dec 23, 2008 1:18 pm wrote:
How do I create menus and submenus so when the user is in a submenu they can go back to the main menu if they want?
You can use a loop. Have an option on each submenu for going back to the main menu. If the user chooses that option, make the code go back to the top of the loop where the main menu is.
DanielG




PostPosted: Tue Dec 23, 2008 6:18 pm   Post subject: RE:Turing Help (urgent)

easiest way is to use procedures, make each menu a procedure and when you choose something in a menu, it can just call any of the other menus (or if going back to a previous one, just use return)
Insectoid




PostPosted: Tue Dec 23, 2008 6:58 pm   Post subject: RE:Turing Help (urgent)

you made 3 posts in the same thread in under 4 minutes. 'bumping' is not allowed on compsci, especially 1 minute from the original post.
MikeAlexnder




PostPosted: Tue Dec 23, 2008 7:05 pm   Post subject: RE:Turing Help (urgent)

Can you shoew me how?
syntax_error




PostPosted: Tue Dec 23, 2008 10:21 pm   Post subject: Re: Turing Help (urgent)

code:

proc foo
/* magic code here */
end foo

proc bar
/* magical-er code here */
end bar

proc blag
/* magical-er-er code here */
end blag

loop
 put "foo"
 put "bar"
 put "blag"
 get choice
  if choice ==1
   cls
   loop
   bar
     exitcommand == true then exit
   end loop   
 
  else if choice == 2

   cls
   loop
   blag
     exitcommand == true then exit
   end loop

  else if choice == 3

   cls
   loop
   foo
     exitcommand == true then exit
   end loop

  end if

  end loop
 
end loop






Just a outline.

Note: not to scale.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Wed Dec 24, 2008 10:55 am   Post subject: RE:Turing Help (urgent)

Okay, so the main menu is in a loop. When you click a button, it goes to that menu's procedure, which contains a loop. When you click 'back', it exits that loop, which will then return to the main menu.

syntax_error, in Turing comparisons are done with a single = rather than ==. Just pointing it out Razz.

Turing:

proc menu1
    loop
        %mouse stuff
        exit when exitButton clicked
    end loop
end menu1

proc menu2
    %same as menu1, but with different options
end menu2

%main menu
loop
    if menu1 button clicked then
        menu1
    elsif menu2 button clicked then
        menu2
    end if
end loop
MikeAlexnder




PostPosted: Wed Dec 24, 2008 1:02 pm   Post subject: RE:Turing Help (urgent)

Can you help me edit my program so it will be in this form? If anyone can than I will send you my program or post it. My program is done and fuctional I just need to put in in the form above. I tried but I failed Crying or Very sad
Insectoid




PostPosted: Wed Dec 24, 2008 1:05 pm   Post subject: RE:Turing Help (urgent)

Nope. That's called 'thinking'. It's a huge part of programming.
MikeAlexnder




PostPosted: Wed Dec 24, 2008 1:06 pm   Post subject: RE:Turing Help (urgent)

PLEASE!!!I BEG YOU!!!!
S_Grimm




PostPosted: Wed Dec 24, 2008 1:18 pm   Post subject: RE:Turing Help (urgent)

1) Caps Lock should be off when typing
2) We don't do work for you. We will point you in the right direction and give you samples, but never will we write the code for you. EVER.

3) The Code is in this thread. Just take a look. Think about how to do it, then implement it. Don't worry if it doesn't work at first, just trouble shoot it untill you get it to work.

4) If / Else constructs
MikeAlexnder




PostPosted: Wed Dec 24, 2008 8:07 pm   Post subject: RE:Turing Help (urgent)

It doesn't work!!!!
Insectoid




PostPosted: Wed Dec 24, 2008 8:35 pm   Post subject: Re: RE:Turing Help (urgent)

AV @ Wed Dec 24, 2008 1:18 pm wrote:
The Code is in this thread. Just take a look. Think about how to do it, then implement it. Don't worry if it doesn't work at first, just trouble shoot it untill you get it to work.


If it doesn't work, you haven't done this.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: