*Author

Active members:
Jenkar(1)

Offline JenkarTopic starter

  • Legendary Member
  • ******
  • Posts: 4199
  • Country: fr
  • Reputation Power: 58
  • Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.Jenkar is truly a Titan, worthy of respect and acknowledgement.
  • Heart's made of shadows
  • Awards: Slice of Elements 8th Birthday CakeSlice of Elements 7th Birthday CakeChampionship League 2/2013 WinnerSlice of Elements 4th Birthday Cake6th Trials - Master of AirWinner of Revive the Archive 2!Slice of Elements 3rd Birthday CakeBeginners League 1/2012 WinnerWeekly Tournament Winner5th Trials - Master of AirAvatar of Patience - Winner of the 7 Heavenly Virtues Deck CompetitionBeginners League 3/2011 3rd PlaceC-C-C-Combo Maker Winner!
Human ressource machine https://elementscommunity.org/forum/index.php?topic=61895.msg1232201#msg1232201
« on: May 04, 2016, 07:54:43 pm »
Pretty fun coding game so far. Recommend getting the current humble bundle for it!
I've never coded so sloppy optimized code.


TL;DR : this multiplies numbers 2 per 2, outputting the result in the outbox.
The way it does this isn't that complex :
it takes a number.
if it's 0, it puts in the output, gets the next number, then restarts the program.
otherwise, it memorizes it in cell 0 & res, then moves to the next number

0? then output it and restart

Otherwise, memorize in inc. Then subtract 1 from inc & copy (because, we already have 1*the number to multiply in Res)
If it's now 0, that means res has our result, get result from res, output, restart program
otherwise, start a main loop to multiply, as long as inc-1 is > 0, get the number from res, add the number to res, put it in res, repeat.
When inc-1 = 0, we have one iteration left.
Get from res, add the number to res. And output. And restart program.

The inc-1 condition allows for saving a "put in res, get from res" for each execution with inc & number > 0.

Yeah, i'm a little obsessed with coding :P
« Last Edit: May 04, 2016, 08:06:08 pm by Jenkar »
The madness is in each of us. Close your eyes, sing, and open your webbed wings to the silent winds.
Beautiful art : http://i.imgur.com/eUhyYCC.png

 

blarg: