Discuss Scratch

cutepuppy661
Scratcher
43 posts

How do you use the block "operators"?

Hi, my name is cutepuppy661 and I need help with the block “oporaters”. I think that they are very confusing. Can you help me please? Thanks.

-cutepuppy661.

Wizard_Chad
Scratcher
38 posts

How do you use the block "operators"?

foo+10thisaddsanumbertoanumber,oravariabletoanumberfoo-10thissubtractsanumbertoanumber,oravariabletoanumberfoo*10thismultipliesanumbertoanumber,oravariabletoanumberfoo/10thisdividesanumbertoanumber,oravariabletoanumberpickrandom0to1givesarandomnumber0or1pickrandom0to1.0givesarandomnumberbetween0and1like0.275or0.1954foo<10checksif"foo"islessthan10andreturnstrueorfalsefoo=10checksif"foo"isequalto10andreturnstrueorfalsefoo>10checksif"foo"isgreaterthan10andreturnstrueorfalsefoo=10andgoo=10ifbotharetrue,itreturnstrue.Iftheyarenotbothtrue,returnsfalse

Last edited by Wizard_Chad (March 7, 2017 02:55:33)

nonethenones
Scratcher
100+ posts

How do you use the block "operators"?

Okami_is_1
Scratcher
43 posts

How do you use the block "operators"?

basically to sum up what others said on here, operator commands are mainly for “if not then” situations and mathematical commands like if you wanted to add a score with a bonus score it would be

Bonus+Score

and that would add them together so you can add them to a leader board or something. Experiment with them a little and youll see they have many uses

Powered by DjangoBB