Discuss Scratch
- Discussion Forums
- » Show and Tell
- » I made a (very basic) calculator!
- FuturePr0
- Scratcher
100+ posts
I made a (very basic) calculator!
I've just shared a new project which is a calculator, it can do division, multiplication, adding, subtracting and square root problems! there are loads of lists and cloud variables for if you want statistics, if there is anything you think I can improve, tell me! You can see the project here.
Last edited by FuturePr0 (March 12, 2018 06:54:20)
BRUH
- FuturePr0
- Scratcher
100+ posts
I made a (very basic) calculator!
if you want to do my method, then you would do this, but if you don't understand then just put all the scripts in your backpack and move them to your project, please credit me because i was ill when i made this: I love how it's basic yet it works so well! I'm also working on a math project but I'm thinking about not doing it anymore because it's not really my style. Any tips?
First of all, you need three variables:
(first number)WARNING: do not use the blue variable from sensing, make your own one from the data section. so it would be orange instead of blue.
(second number)
(answer :: variables) //this is a variable you made, not blue from sensing.
so how this will work is you would have one sprite, that sprite will ask you a question. the sprites first question would be asking you if you want to do division, multiplication, adding, or subtracting.
ask [Do you want to do multiplication, division, adding or subtracting?] and waitnow the next step requires a lot of code, so i'm going to word it. if you still don't understand you can take the script to your backpack with a comment attached to it saying ‘for violet_raven’. And use it for your project, but i would like credit. Because i was VERY ill when i made this project. so you need to program it so that if your answer is ‘division’ it will broadcast ‘division’ if it's multiplication, it would broadcast ‘multiplication’ etc.
if <(answer)= [multiplication]> then //this time you DO want a blue answer block, only for the maths question selection.now you want to make it so on the receiving end it does something, it will ask you what you want the first number to be and what to multiply by, divide add or subtract. A little like this:
broadcast [multiplication v]
end
when I receive [multiplication v]and then this will be the script for the answers:
ask [What do you want the first number to be?] and wait
set [first number v] to (answer) // for this you DO want the blue variable.
ask [what do you want to multiply by?] and wait
set [second number v] to (answer) //still using the blue variable. next step will use the variable you made that's orange.
set [answer v] to ((first number) * (second number)) //the little star means multiply in programming. because there is no 'times' key.(continued) on a normal keyboard. This is useful for if you want to mutliply. but if you want to divide, this would be the script.
set [answer v] to ((first number) / (second number)) //the slash means divide in programming, because there is no 'divide' key.(continued) on a normal keyboard. For adding it would be this:
set [answer v] to ((first number) + (second number)) //there is a plus on a normal keyboard so we just use an adding block.then you could program the cat to say the answer.
set [answer v] to ((first number) - (second number)) //There is a minus key on the keyboard, just use the dash key.
say(join (join (join (join (first number) [add] ) (second number)) [equals] ) (answer :: variables)) //keep in mind your using the orange variable saying 'answer'. nowAnd NEVER give up! have fun!
Last edited by FuturePr0 (Feb. 11, 2018 16:13:34)
BRUH
- TheAwesome98
- Scratcher
37 posts
I made a (very basic) calculator!
if you want to do my method, then you would do this, but if you don't understand then just put all the scripts in your backpack and move them to your project, please credit me because i was ill when i made this: I love how it's basic yet it works so well! I'm also working on a math project but I'm thinking about not doing it anymore because it's not really my style. Any tips?
First of all, you need three variables:(first number)WARNING: do not use the blue variable from sensing, make your own one from the data section. so it would be orange instead of blue.
(second number)
(answer) // this is meant to be orange, not the default blue from sensing.
so how this will work is you would have one sprite, that sprite will ask you a question. the sprites first question would be asking you if you want to do division, multiplication, adding, or subtracting.ask [Do you want to do multiplication, division, adding or subtracting?] and waitnow the next step requires a lot of code, so i'm going to word it. if you still don't understand you can take the script to your backpack with a comment attached to it saying ‘for violet_raven’. And use it for your project, but i would like credit. Because i was VERY ill when i made this project. so you need to program it so that if your answer is ‘division’ it will broadcast ‘division’ if it's multiplication, it would broadcast ‘multiplication’ etc.if <(answer)= [multiplication]> then //this time you DO want a blue answer block, only for the maths question selection.now you want to make it so on the receiving end it does something, it will ask you what you want the first number to be and what to multiply by, divide add or subtract. A little like this:
broadcast [multiplication v]
endwhen I receive [multiplication v]and then this will be the script for the answers:
ask [What do you want the first number to be?] and wait
set [first number v] to (answer) // for this you DO want the blue variable.
ask [what do you want to multiply by?] and wait
set [second number v] to (answer) //still using the blue variable. next step will use the variable you made that's orange.set [answer v] to ((first number) * (second number)) //the little star means multiply in programming. because there is no 'times' key.(continued) on a normal keyboard. This is useful for if you want to mutliply. but if you want to divide, this would be the script.set [answer v] to ((first number) / (second number)) //the slash means divide in programming, because there is no 'divide' key.(continued) on a normal keyboard. For adding it would be this:set [answer v] to ((first number) + (second number)) //there is a plus on a normal keyboard so we just use an adding block.then you could program the cat to say the answer.
set [answer v] to ((first number) - (second number)) //There is a minus key on the keyboard, just use the dash key.say(join (join (join (join (first number) [add] ) (second number)) [equals] ) (answer)) //keep in mind your still using the orange variable saying 'answer'.And NEVER give up! have fun!
(first number)
(second number)
(answer :: variables)
you know how someone can be smart and dumb?? I’m like that
when green flag clickedhow are you here? did they extend signatures or are you using the debugger? Anyway, it’s good to see you. I might put an Easter egg or some sort of ARG down here one day but for now, no.
think of a good signature::custom
set [output v] to (output of last [think of a good signature v]::custom)
if <(output::variables) fails::custom> then
make some more sus blocks::operators // figured out comments it’s just common “//” syntax
wait until <boolean variable::variables>
grey::grey
ring ({
test::grey
}::ring)::operators //works?? Can’t see it cause of sig height (can do later on desktop, see below)
end
Turns out, ctrl-shift-down while highlighting lets you see more so this is useless, but cool to know.
- FuturePr0
- Scratcher
100+ posts
I made a (very basic) calculator!
Yes, those are the three variables you need (Thanks! ), and If you want square root, just useif you want to do my method, then you would do this, but if you don't understand then just put all the scripts in your backpack and move them to your project, please credit me because i was ill when i made this: I love how it's basic yet it works so well! I'm also working on a math project but I'm thinking about not doing it anymore because it's not really my style. Any tips?
First of all, you need three variables:(first number)WARNING: do not use the blue variable from sensing, make your own one from the data section. so it would be orange instead of blue.
(second number)
(answer) // this is meant to be orange, not the default blue from sensing.
so how this will work is you would have one sprite, that sprite will ask you a question. the sprites first question would be asking you if you want to do division, multiplication, adding, or subtracting.ask [Do you want to do multiplication, division, adding or subtracting?] and waitnow the next step requires a lot of code, so i'm going to word it. if you still don't understand you can take the script to your backpack with a comment attached to it saying ‘for violet_raven’. And use it for your project, but i would like credit. Because i was VERY ill when i made this project. so you need to program it so that if your answer is ‘division’ it will broadcast ‘division’ if it's multiplication, it would broadcast ‘multiplication’ etc.if <(answer)= [multiplication]> then //this time you DO want a blue answer block, only for the maths question selection.now you want to make it so on the receiving end it does something, it will ask you what you want the first number to be and what to multiply by, divide add or subtract. A little like this:
broadcast [multiplication v]
endwhen I receive [multiplication v]and then this will be the script for the answers:
ask [What do you want the first number to be?] and wait
set [first number v] to (answer) // for this you DO want the blue variable.
ask [what do you want to multiply by?] and wait
set [second number v] to (answer) //still using the blue variable. next step will use the variable you made that's orange.set [answer v] to ((first number) * (second number)) //the little star means multiply in programming. because there is no 'times' key.(continued) on a normal keyboard. This is useful for if you want to mutliply. but if you want to divide, this would be the script.set [answer v] to ((first number) / (second number)) //the slash means divide in programming, because there is no 'divide' key.(continued) on a normal keyboard. For adding it would be this:set [answer v] to ((first number) + (second number)) //there is a plus on a normal keyboard so we just use an adding block.then you could program the cat to say the answer.
set [answer v] to ((first number) - (second number)) //There is a minus key on the keyboard, just use the dash key.say(join (join (join (join (first number) [add] ) (second number)) [equals] ) (answer)) //keep in mind your still using the orange variable saying 'answer'.And NEVER give up! have fun!(first number)
(second number)
(answer :: variables)
([sqrt v] of (first number)
BRUH
- TheAwesome98
- Scratcher
37 posts
I made a (very basic) calculator!
You do block :: name of type for example variablesYes, those are the three variables you need (Thanks! ), and If you want square root, just useif you want to do my method, then you would do this, but if you don't understand then just put all the scripts in your backpack and move them to your project, please credit me because i was ill when i made this: I love how it's basic yet it works so well! I'm also working on a math project but I'm thinking about not doing it anymore because it's not really my style. Any tips?
First of all, you need three variables:(first number)WARNING: do not use the blue variable from sensing, make your own one from the data section. so it would be orange instead of blue.
(second number)
(answer) // this is meant to be orange, not the default blue from sensing.
so how this will work is you would have one sprite, that sprite will ask you a question. the sprites first question would be asking you if you want to do division, multiplication, adding, or subtracting.ask [Do you want to do multiplication, division, adding or subtracting?] and waitnow the next step requires a lot of code, so i'm going to word it. if you still don't understand you can take the script to your backpack with a comment attached to it saying ‘for violet_raven’. And use it for your project, but i would like credit. Because i was VERY ill when i made this project. so you need to program it so that if your answer is ‘division’ it will broadcast ‘division’ if it's multiplication, it would broadcast ‘multiplication’ etc.if <(answer)= [multiplication]> then //this time you DO want a blue answer block, only for the maths question selection.now you want to make it so on the receiving end it does something, it will ask you what you want the first number to be and what to multiply by, divide add or subtract. A little like this:
broadcast [multiplication v]
endwhen I receive [multiplication v]and then this will be the script for the answers:
ask [What do you want the first number to be?] and wait
set [first number v] to (answer) // for this you DO want the blue variable.
ask [what do you want to multiply by?] and wait
set [second number v] to (answer) //still using the blue variable. next step will use the variable you made that's orange.set [answer v] to ((first number) * (second number)) //the little star means multiply in programming. because there is no 'times' key.(continued) on a normal keyboard. This is useful for if you want to mutliply. but if you want to divide, this would be the script.set [answer v] to ((first number) / (second number)) //the slash means divide in programming, because there is no 'divide' key.(continued) on a normal keyboard. For adding it would be this:set [answer v] to ((first number) + (second number)) //there is a plus on a normal keyboard so we just use an adding block.then you could program the cat to say the answer.
set [answer v] to ((first number) - (second number)) //There is a minus key on the keyboard, just use the dash key.say(join (join (join (join (first number) [add] ) (second number)) [equals] ) (answer)) //keep in mind your still using the orange variable saying 'answer'.And NEVER give up! have fun!(first number)
(second number)
(answer :: variables)([sqrt v] of (first number)
Last edited by TheAwesome98 (Feb. 11, 2018 16:18:14)
you know how someone can be smart and dumb?? I’m like that
when green flag clickedhow are you here? did they extend signatures or are you using the debugger? Anyway, it’s good to see you. I might put an Easter egg or some sort of ARG down here one day but for now, no.
think of a good signature::custom
set [output v] to (output of last [think of a good signature v]::custom)
if <(output::variables) fails::custom> then
make some more sus blocks::operators // figured out comments it’s just common “//” syntax
wait until <boolean variable::variables>
grey::grey
ring ({
test::grey
}::ring)::operators //works?? Can’t see it cause of sig height (can do later on desktop, see below)
end
Turns out, ctrl-shift-down while highlighting lets you see more so this is useless, but cool to know.
- FuturePr0
- Scratcher
100+ posts
I made a (very basic) calculator!
I know. Thanks!You do block :: name of type for example variablesYes, those are the three variables you need (Thanks! ), and If you want square root, just useif you want to do my method, then you would do this, but if you don't understand then just put all the scripts in your backpack and move them to your project, please credit me because i was ill when i made this: I love how it's basic yet it works so well! I'm also working on a math project but I'm thinking about not doing it anymore because it's not really my style. Any tips?
First of all, you need three variables:(first number)WARNING: do not use the blue variable from sensing, make your own one from the data section. so it would be orange instead of blue.
(second number)
(answer) // this is meant to be orange, not the default blue from sensing.
so how this will work is you would have one sprite, that sprite will ask you a question. the sprites first question would be asking you if you want to do division, multiplication, adding, or subtracting.ask [Do you want to do multiplication, division, adding or subtracting?] and waitnow the next step requires a lot of code, so i'm going to word it. if you still don't understand you can take the script to your backpack with a comment attached to it saying ‘for violet_raven’. And use it for your project, but i would like credit. Because i was VERY ill when i made this project. so you need to program it so that if your answer is ‘division’ it will broadcast ‘division’ if it's multiplication, it would broadcast ‘multiplication’ etc.if <(answer)= [multiplication]> then //this time you DO want a blue answer block, only for the maths question selection.now you want to make it so on the receiving end it does something, it will ask you what you want the first number to be and what to multiply by, divide add or subtract. A little like this:
broadcast [multiplication v]
endwhen I receive [multiplication v]and then this will be the script for the answers:
ask [What do you want the first number to be?] and wait
set [first number v] to (answer) // for this you DO want the blue variable.
ask [what do you want to multiply by?] and wait
set [second number v] to (answer) //still using the blue variable. next step will use the variable you made that's orange.set [answer v] to ((first number) * (second number)) //the little star means multiply in programming. because there is no 'times' key.(continued) on a normal keyboard. This is useful for if you want to mutliply. but if you want to divide, this would be the script.set [answer v] to ((first number) / (second number)) //the slash means divide in programming, because there is no 'divide' key.(continued) on a normal keyboard. For adding it would be this:set [answer v] to ((first number) + (second number)) //there is a plus on a normal keyboard so we just use an adding block.then you could program the cat to say the answer.
set [answer v] to ((first number) - (second number)) //There is a minus key on the keyboard, just use the dash key.say(join (join (join (join (first number) [add] ) (second number)) [equals] ) (answer)) //keep in mind your still using the orange variable saying 'answer'.And NEVER give up! have fun!(first number)
(second number)
(answer :: variables)([sqrt v] of (first number)
BRUH
- TheAwesome98
- Scratcher
37 posts
I made a (very basic) calculator!
Ah.I know. Thanks!You do block :: name of type for example variablesYes, those are the three variables you need (Thanks! ), and If you want square root, just useif you want to do my method, then you would do this, but if you don't understand then just put all the scripts in your backpack and move them to your project, please credit me because i was ill when i made this: I love how it's basic yet it works so well! I'm also working on a math project but I'm thinking about not doing it anymore because it's not really my style. Any tips?
First of all, you need three variables:(first number)WARNING: do not use the blue variable from sensing, make your own one from the data section. so it would be orange instead of blue.
(second number)
(answer) // this is meant to be orange, not the default blue from sensing.
so how this will work is you would have one sprite, that sprite will ask you a question. the sprites first question would be asking you if you want to do division, multiplication, adding, or subtracting.ask [Do you want to do multiplication, division, adding or subtracting?] and waitnow the next step requires a lot of code, so i'm going to word it. if you still don't understand you can take the script to your backpack with a comment attached to it saying ‘for violet_raven’. And use it for your project, but i would like credit. Because i was VERY ill when i made this project. so you need to program it so that if your answer is ‘division’ it will broadcast ‘division’ if it's multiplication, it would broadcast ‘multiplication’ etc.if <(answer)= [multiplication]> then //this time you DO want a blue answer block, only for the maths question selection.now you want to make it so on the receiving end it does something, it will ask you what you want the first number to be and what to multiply by, divide add or subtract. A little like this:
broadcast [multiplication v]
endwhen I receive [multiplication v]and then this will be the script for the answers:
ask [What do you want the first number to be?] and wait
set [first number v] to (answer) // for this you DO want the blue variable.
ask [what do you want to multiply by?] and wait
set [second number v] to (answer) //still using the blue variable. next step will use the variable you made that's orange.set [answer v] to ((first number) * (second number)) //the little star means multiply in programming. because there is no 'times' key.(continued) on a normal keyboard. This is useful for if you want to mutliply. but if you want to divide, this would be the script.set [answer v] to ((first number) / (second number)) //the slash means divide in programming, because there is no 'divide' key.(continued) on a normal keyboard. For adding it would be this:set [answer v] to ((first number) + (second number)) //there is a plus on a normal keyboard so we just use an adding block.then you could program the cat to say the answer.
set [answer v] to ((first number) - (second number)) //There is a minus key on the keyboard, just use the dash key.say(join (join (join (join (first number) [add] ) (second number)) [equals] ) (answer)) //keep in mind your still using the orange variable saying 'answer'.And NEVER give up! have fun!(first number)
(second number)
(answer :: variables)([sqrt v] of (first number)
you know how someone can be smart and dumb?? I’m like that
when green flag clickedhow are you here? did they extend signatures or are you using the debugger? Anyway, it’s good to see you. I might put an Easter egg or some sort of ARG down here one day but for now, no.
think of a good signature::custom
set [output v] to (output of last [think of a good signature v]::custom)
if <(output::variables) fails::custom> then
make some more sus blocks::operators // figured out comments it’s just common “//” syntax
wait until <boolean variable::variables>
grey::grey
ring ({
test::grey
}::ring)::operators //works?? Can’t see it cause of sig height (can do later on desktop, see below)
end
Turns out, ctrl-shift-down while highlighting lets you see more so this is useless, but cool to know.
- FuturePr0
- Scratcher
100+ posts
I made a (very basic) calculator!
I only do it when I'm replying to something. wow lol you know you don't need to quote every time you comment? XD
BRUH
- Scoopy55555
- Scratcher
28 posts
I made a (very basic) calculator!
What I was meant to say was that everyone's message is a good way and I would of done the same!
Scoopy55555
- Adam_TheYt
- Scratcher
28 posts
I made a (very basic) calculator!
This is my Calculator
Please do not necropost.
hmmm
- Discussion Forums
- » Show and Tell
- » I made a (very basic) calculator!