We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › I'm stuck....
Page Index Toggle Pages: 1
I'm stuck.... (Read 623 times)
I'm stuck....
May 4th, 2010, 1:52pm
 
I have to make a program that do this

"Write a Processing program that simulates a “clicker” to count attendance. Your
program should display a sequence of digits (initially all 0s) in the center of the
window. Two marked areas inside the window represent “count” and “reset” buttons.
When the user clicks on the “count” button, the numeric counter should increase by 1.
When the user clicks on the “reset” button, the counter should reset itself to 0. Your
counter must have at least 4 digits; when the counter reaches all 9s, clicking on the
“count” button should cause it to roll over to all 0s and begin counting up from 1
again. You can use the text display functions from Chapter 17 to do this, or you can
display your counter using image files. "

What i have is to display the 4 digits, and the count button, and reset button on the screen. But i don't know how to make the count button increase 1 each time its clicked. and also the reset button. Currently using "String" to display the 4 digits. and "text" for the buttons.

-stuck at displaying the 4 initail 0's. since typing int a=0000; will only display one 0.

any help would be great. Thanks
Re: I'm stuck....
Reply #1 - May 4th, 2010, 2:46pm
 
Look up the nf() function in the reference, that should get you started.
Page Index Toggle Pages: 1