#lang racket ;; A naive iimplementation of fibonacci (define (fib n) (cond [(<= n 2) 1] [else (+ (fib (- n 1)) (fib (- n 2)))])) (define (fibonacci n) (cond [(or (not n) (< n 0)) (display "Usage: please input the count of fibonacci numbers to output")] [else (for ([i (in-range 1 (add1 n))]) (displayln (string-append (number->string i) ": " (number->string (fib i))))) ])) (fibonacci (string->number (cond [(vector-empty? (current-command-line-arguments)) ""] [else (vector-ref (current-command-line-arguments) 0)] ) ) )
If you see anything you’d like to change or update, please consider contributing.
Note: The solution shown above is the current solution in the Sample Programs repository as of May 10 2022 22:08:48. The solution was first committed on Oct 31 2019 22:31:00. As a result, documentation below may be outdated.
No ‘How to Implement the Solution’ section available. Please consider contributing.
No ‘How to Run the Solution’ section available. Please consider contributing.