Wikia

FiM++ Community Wiki

Changes: Decrement

Edit

Back to page

(Example: Forgot to explain ^^;)
(Example: oops wrong Java example)
 
Line 16: Line 16:
 
Its Java equivalent is as follows:
 
Its Java equivalent is as follows:
 
{{codeblock|<SOURCE LANG=java>Spike--;
 
{{codeblock|<SOURCE LANG=java>Spike--;
cider--;
+
--cider;
 
cider -= Spike;</SOURCE>}}
 
cider -= Spike;</SOURCE>}}
   

Latest revision as of 15:38, October 29, 2014

The decrement operator is a special case of subtraction, and subtracts the a number from a variable. This cannot be used on literals or constants. This operator is a single instruction by itself and can only affect one variable at a time.

FDS Edit

Example Edit

Spike got one less.
Icon Warning There was one less cider.
I would Icon Warning subtract Spike Icon Warning from cider.

This subtracts 1 from the variable Spike and then from cider, and then subtracts Spike from cider.

Its Java equivalent is as follows:

Spike--;
--cider;
cider -= Spike;

See Also Edit


Around Wikia's network

Random Wiki