Select language
Search the Site
Ceebot / Dauphin Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Schoolbooks-->Branches-->Insect attack (2 viewing) (2) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Schoolbooks-->Branches-->Insect attack
#28
admin (Admin)
Admin
Posts: 3
graphgraph
User Online Now Click here to see the profile of this user
Re:Schoolbooks-->Branches-->Insect attack 12 Years, 11 Months ago Karma: 1  
I don't understand why you want to use a switch statement. Simple if statements are better adapted to this exercise. You could use a switch statement if you have got a variable which contains the code of the key which has been previously pushed by the user. In this case you could use a switch on the content of this variable.

Your program looks quite OK, with the exception of the aim angle. You will probably have to allow for more possibilities than just 20 degrees upward and 20 degrees down. And why do you use the else statements? If the user pushes two keys at the same time, we would like the robot to perform both actions. Like this, you can write a program which is less complicated.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
      Topics Author Date
    thread link
Schoolbooks-->Branches-->Insect attack
wJack 2008/10/30 15:37
    thread link
thread linkthread link Re:Schoolbooks-->Branches-->Insect attack
admin 2008/10/30 16:39
    emo
thread linkthread link Re:Schoolbooks-->Branches-->Insect attack
wJack 2008/10/30 19:43
    thread link
thread linkthread linkthread link Re:Schoolbooks-->Branches-->Insect attack
admin 2008/10/30 21:20
    thread link
thread linkthread linkthread linkthread link Re:Schoolbooks-->Branches-->Insect attack
wJack 2008/10/30 21:49
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop