easy count

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
greggarcia
Posts: 33
Joined: Mon Apr 27, 2009 3:32 pm
Contact:

easy count

Post by greggarcia » Wed May 06, 2009 12:36 am

Hello i am still testing RR and i do not how make an easy counting of hit, would you mind help me? i am doing just to play several question with "answer" if the kid hit the right answer i would like to count how many right answer his or her get.

Thanks
Greg Garcia

acidjazz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 93
Joined: Mon Feb 16, 2009 2:37 am

Post by acidjazz » Wed May 06, 2009 5:07 am

Greg,

How about this....

Code: Select all

on mouseUp
   
   answer "Which is further north? with "Spain" and "England"
   If it is "England" then  
      add 1 to counter
      answer "Right!  You now have answered" && counter && "questions correctly!" 
   else if it is "Spain" then
      answer "Sorry"   
   end if
   
   answer "Which is larger?  with "10 x 2" and "3 x 4" 
   If it is "10 x 2" then  
      add 1 to counter
      answer "Right!  You now have answered" && counter && "questions correctly!" 
   else if it is "3 x 4" then
      answer "Sorry" 
   end if
    
end mouseUp

There are many ways to do this, but an if/then statement with another answer command to give feedback is probably the easiest.

Best,
Mark P.

greggarcia
Posts: 33
Joined: Mon Apr 27, 2009 3:32 pm
Contact:

Post by greggarcia » Wed May 06, 2009 1:35 pm

Mark, Thanks so much, that's works and more important gave an idea how RR language works.

Good day.
Greg

Post Reply