This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-11-25 12:03:39

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Just Basic code center

I just got help and tutorials working!  big_smile
If you have justbasic, (Here, if you don't), try this code for a simple calculator I made!

Code:

'Calculator made by 16skittles
'this sets up a goto feature that resets the program
[startloop]
'inputs and the prompts
input "type the 1st number  "; first
input "type the function (add=1, subtract=2, multiply=3, divide=4)  "; funct
input "type the 2nd number   "; second
'now for the code that actually interprets the numbers and fuctions
if funct = 1 then
print first + second
end if
if funct = 2 then
print first - second
end if
if funct = 3 then
print first * second
end if
if funct = 4 then
print first / second
end if
'this just asks if you want to quit or continue
input "Reset or quit? (reset=1 quit=2)"; choice
if choice = 1 then [startloop]
end

without comments:

Code:

[startloop]
input "type the 1st number  "; first
input "type the function (add=1, subtract=2, multiply=3, divide=4)  "; funct
input "type the 2nd number   "; second
if funct = 1 then
print first + second
end if
if funct = 2 then
print first - second
end if
if funct = 3 then
print first * second
end if
if funct = 4 then
print first / second
end if
input "Reset or quit? (reset=1 quit=2)"; choice
if choice = 1 then [startloop]
end

either one should work.
Add your own!  big_smile


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#2 2010-11-25 13:04:24

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Just Basic code center

bump!


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#3 2010-11-25 17:55:56

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Just Basic code center

bumpeth. nobody else programs just basic?


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#4 2010-11-26 10:28:34

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Just Basic code center

will someone post please?


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#5 2010-11-26 11:38:33

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Just Basic code center

seriously?


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#6 2010-11-26 11:44:31

fire219
Scratcher
Registered: 2008-02-07
Posts: 1000+

Re: Just Basic code center

I have Just Basic, but I don't use it anymore because it crashes alot.  sad


http://bluetetrarpg.x10.mx/usercard/img.php?name=fire219

Offline

 

Board footer