Skip to content

Instantly share code, notes, and snippets.

@kilon
Last active September 3, 2016 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kilon/8c43f3fc83856f27e03ddc6814a25f69 to your computer and use it in GitHub Desktop.
Save kilon/8c43f3fc83856f27e03ddc6814a25f69 to your computer and use it in GitHub Desktop.
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