Skip to content

Instantly share code, notes, and snippets.

@kilon kilon/linesOfCode.st
Last active Sep 3, 2016

Embed
What would you like to do?
Compute the lines of code per day with a 12% increase each year to reach a total of 1 million lines of code, starting with 10 lines of code per day
y := 10.
Transcript clear.
Transcript show: '****************************';cr;
show: '* BEGIN COMPUTATION *';cr;
show: '****************************';cr.
(1 to: 30 ) do: [ :time|
Transcript show:'On year ';show:(time asString );show: ' '.
Transcript show: 'you code ' ;show: ((y*(1.12**time)) rounded)asString ;
show:' lines of code per day.';cr].
x := 3650.
(1 to: 30 ) do: [ :time|
x := (3650* (1.12**time))+x ].
Transcript show: '=============================';cr;
show: 'Total lines of code: ';show: (x rounded )asString;cr;
show: '============================='.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.