This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1c31 | |
< @library = find_python_lib | |
--- | |
> @library = 'python2' | |
126c126 | |
< %x(#{@python} -c "#{command}").chomp if @python | |
--- | |
> %x("#{@python} -c #{command}").chomp if @python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Write a function similar to `triangle' in which each row has a value which is the square of the row number. Use a `while' loop. | |
(defun square-triangle (number-of-rows) | |
"Calculate the total number of pebbles in a triangle where the number of | |
pebbles in each row is the square of the number of the row." | |
(let ((total 0) | |
(row-number 1)) | |
(while (<= row-number number-of-rows) | |
(setq total (+ total (* row-number row-number))) | |
(setq row-number (1+ row-number))) |
NewerOlder