User talk:Chunes: Difference between revisions

Line 21:
Compute the factorial of 5 giving a number.
Write "" then the number on the console.</lang>
:I've seen this "giving" phrasing in the noodle as well, and I think it's a fairly elegant solution. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 15:48, 25 September 2020 (UTC)
 
:Another (weird) way you could go with it is just embrace mutating a single argument.
:<lang plainenglish>To factorialize a number:
If the number is 1, exit.
Put the number minus 1 into another number.
Factorialize the other number.
Multiply the number by the other number.
 
\Calling the routine
Put 5 into a number. Factorialize the number.
Write "" then the number on the console.</lang> --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 15:48, 25 September 2020 (UTC)
1,808

edits