- https://github.com/Abica/ruby-99-problems
- https://github.com/hcf/99-problems-in-Ruby
- https://github.com/kevinrutherford/rrwb-code
- https://github.com/lisafrench/JavaScriptExercises
- https://github.com/beastaugh/js-programming-exercises
- https://github.com/timestep/javascript-exercises
- https://github.com/wvmitchell/javascript
- install leiningen
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Make changes
- Run tests (
lein test
). - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Check if Request passed Travis-Ci
---
level: easy # (elementary|easy|medium|hard)
tags: [string, numbers]
description: this is description
author:
github_nickname: your_name
web_page: "http://your.site"
checks:
ruby:
assert_equal 0, fibo_finder(0)
assert_equal 1, fibo_finder(1)
assert_equal 3, fibo_finder(4)
assert_equal 13, fibo_finder(7)
assert_equal 55, fibo_finder(10)
multicode_checks:
langs: [javascript] #[ruby, javascript, python, php]
If you need special things in your task, such as some Ruby objects, write asserts in "checks:" section. If your task is multiplatform write asserts in "multicode_checks:" section.
(deftest test-asserts
(let [arr [\a \b \c]]
(assert-equal \b (fetch arr 1 \d))
(assert-equal \d (fetch arr 5 \d))
(assert-equal \c (fetch arr -1 \d))
(assert-equal \d (fetch arr -5 \d))))
(ns battle-solutions.array-fetch-test
(:require [clojure.test :refer :all]
[battle-asserts.test-helper :refer [assert-equal assert]]))
(defn fetch
[s index default]
(let [positive-index (if (> index 0) index (+ (count s) index))]
(nth s positive-index default)))
lein test battle-solutions.array-fetch-test