This file contains hidden or 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
| d1 | |
| $ degradeBy (0.25) | |
| $ plyWith 4 (|* speed 1.2) | |
| $ s "~ hh*2" | |
| # sustain 0.2 | |
| # room 0.5 # size 0.7 | |
| # pan rand | |
| # gain 1.15 | |
| d5 |
This file contains hidden or 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
| import Data.List | |
| hangman :: [Char] -> [Char] -> Bool | |
| hangman sw lc = sw == (sw `intersect` lc) |
This file contains hidden or 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
| defmodule ElixirChallenge do | |
| def transform(data) do | |
| data | |
| |> Map.to_list() | |
| |> Enum.reverse() | |
| |> Enum.reduce( | |
| [], | |
| fn {_, listOfElement}, accumulator -> | |
| if accumulator == [] do | |
| accumulator ++ listOfElement |
This file contains hidden or 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
| module Shape | |
| ( area | |
| , perimeter | |
| , maxArea | |
| , maxPerimeter | |
| , max | |
| , Shape (Circle, Rectangle, Square) | |
| ) where | |
| data Shape = Circle Float | Rectangle Float Float | Square Float deriving(Show) |
This file contains hidden or 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
| module MarsRovers | |
| ( Direction (North, East, West, South) | |
| , Rotation (CounterClockWise, ClockWise) | |
| , Position | |
| , Rover | |
| , Plateau | |
| , Command | |
| , Commands | |
| , move | |
| , turn |
This file contains hidden or 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
| import java.io.Serializable; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.NoSuchElementException; | |
| import java.util.function.Function; | |
| class Teddy { | |
| private final String name; |
This file contains hidden or 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
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.function.Function; | |
| import java.util.stream.Collectors; | |
| class Box<T> { | |
| List<T> l; | |
| Box(List<T> l){ |
This file contains hidden or 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
| class Box<T> { | |
| List<T> l; | |
| Box(List<T> l){ | |
| this.l = l; | |
| } | |
| public <E> Box<E> map(Function<? super T, ? extends E> f){ | |
| List<E> result = new ArrayList<>(); | |
| for(int i = 0; i < this.l.size(); i++){ |
This file contains hidden or 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
| (defn build-new-ds [result ds] | |
| (if (empty? ds) | |
| result | |
| (let [province (get (first ds) :province) | |
| amphoe (get (first ds) :amphoe) | |
| district (get (first ds) :district)] | |
| (if (contains? result province) | |
| (recur | |
| (assoc result province | |
| (assoc (province result) amphoe |
This file contains hidden or 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
| (def init-key (vec (map str "abcdefghijklmnopqrstuvwxyz"))) | |
| (defn fill-up-keyword [keyword message] | |
| (apply str | |
| (take (count message) (apply str | |
| (repeat (count message) keyword))))) | |
| (defn get-char-encode [a b] | |
| (nth init-key | |
| (mod (+ |
NewerOlder