- Ruby
- JavaScript
- Haskell
- Python
- Java
- CoffeeScript
- C#
- Clojure
- C++
- PHP
- Crystal
- F#
- Rust
- C
- TypeScript
- Swift
- Shell
- R (Beta)
- Objective-C (Beta)
- OCaml (Beta)
- Elixir
- Lua
- Julia (Beta)
- Scala
- PowerShell (Beta)
- Go
- Nim (Beta)
- Racket
- Reason (Beta)
- Kotlin
- Prolog (Beta)
- Haxe (Beta)
- Pascal (Beta)
- Perl (Beta)
- Elm (Beta)
- COBOL (Beta)
- D (Beta)
- Erlang (Beta)
Start training on this collection. Each time you skip or complete a kata you will be taken to the next kata in the series. Once you cycle through the items in the collection you will revert back to your normal training routine.
DescriptionEdit
def dirReduc(arr)
arr.each_with_index do |direction, index|
if direction == "NORTH"
if arr[index + 1] == "SOUTH"
arr.slice!(index, 2)
dirReduc(arr)
end
elsif direction == "SOUTH"
if arr[index + 1] == "NORTH"
arr.slice!(index, 2)
dirReduc(arr)
end
elsif direction == "EAST"
if arr[index + 1] == "WEST"
arr.slice!(index, 2)
dirReduc(arr)
end
elsif direction == "WEST"
if arr[index + 1] == "EAST"
arr.slice!(index, 2)
dirReduc(arr)
end
else
return arr
end
end
end