Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
number entries
Old
sel
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2012
Location: Australia
Default number entries - 04-11-2012, 12:31 AM

Hi everyone
how do we get to count how many numbers we enter?
so it can print the numbers we entered?
thank you
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 04-11-2012, 08:42 AM

I'm not 100% sure what you mean, but every time you enter a number you could increase the value of some variable, then when printing the numbers put that variable as the value into a while loop


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
number counting in Alice
Old
sel
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2012
Location: Australia
Default number counting in Alice - 04-12-2012, 02:07 AM

Quote:
Originally Posted by sel View Post
Hi everyone
how do we get to count how many numbers we enter?
so it can print the numbers we entered?
thank you

for example.......if i enter in keyboard 1.2.3.4.5.6.......

the print line to be ..
Number Entered is 6.
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 04-12-2012, 06:43 AM

So something like this:

Code:
print "Enter -1 to stop entering numbers."
while(p != -1)
{
      p set value to Ask user for a number
      numOfNums = numOfNums + 1
}

print the number of numbers entered was:
print numOfNums as string


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
Dennis7
Junior Member
 
Status: Offline
Posts: 2
Join Date: May 2012
Default 05-30-2012, 12:18 AM

what numbers are you talking about?






minecraft server list
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.