diff options
| author | Mistivia <i@mistivia.com> | 2024-02-25 20:11:54 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2024-02-25 20:11:54 +0800 |
| commit | 515ecbf5a20a8e432a998b0a543bedcb1bd64cf4 (patch) | |
| tree | 6353c603a8cf0276553f420205f8d1c730a318ce /codewars | |
| parent | e191b610c11326b587cf0b01fd6fc37b8d07bb19 (diff) | |
reorg code
Diffstat (limited to 'codewars')
| -rw-r--r-- | codewars/6-kyu/pyramid-array/solution.rkt | 14 | ||||
| -rw-r--r-- | codewars/7-kyu/a-rule-of-divisibility-by-7/solution.rkt | 15 |
2 files changed, 0 insertions, 29 deletions
diff --git a/codewars/6-kyu/pyramid-array/solution.rkt b/codewars/6-kyu/pyramid-array/solution.rkt deleted file mode 100644 index 0d6a00b..0000000 --- a/codewars/6-kyu/pyramid-array/solution.rkt +++ /dev/null @@ -1,14 +0,0 @@ -#lang racket - -;; https://www.codewars.com/kata/515f51d438015969f7000013 - -(provide pyramid) - -(define (pyramid n) - (define (loop ret level cur) - (define next (cons 1 cur)) - (if (= level n) - (reverse ret) - (loop (cons next ret) (+ level 1) next))) - (loop '() 0 '())) - diff --git a/codewars/7-kyu/a-rule-of-divisibility-by-7/solution.rkt b/codewars/7-kyu/a-rule-of-divisibility-by-7/solution.rkt deleted file mode 100644 index 6859107..0000000 --- a/codewars/7-kyu/a-rule-of-divisibility-by-7/solution.rkt +++ /dev/null @@ -1,15 +0,0 @@ -#lang racket - -;; https://www.codewars.com/kata/55e6f5e58f7817808e00002e - -(provide seven) - -(define (seven m) - (define (impl cur steps) - (define x (quotient cur 10)) - (define y (modulo cur 10)) - (define next (- x (* 2 y))) - (if (< cur 100) - (cons cur steps) - (impl next (+ 1 steps)))) - (impl m 0)) |
