fizzbuzz.py の内容をコピーしてローカルに保存し、以下のコマンドで実行可能であることを確認しましょう。
$ python fizzbuzz.py
| class ModuloTranslation: | |
| """ | |
| 割り算のあまり(modulo)を文字列に変換するクラス | |
| """ | |
| def __init__(self, modulo, to_string): | |
| self.modulo = modulo | |
| self.to_string = to_string | |
| def translate(self, n): |
| all: index.html debug.html | |
| debug.html: src/Main.elm elm.json | |
| elm make src/Main.elm --debug --output=debug.html | |
| index.html: src/Main.elm elm.json | |
| elm make src/Main.elm --optimize --output=index.html |
| #!/bin/bash | |
| set -e | |
| reverse () { | |
| local COUNT | |
| COUNT=$# | |
| local PARAMS | |
| PARAMS=("$@") |
| INITIAL_COINS = 0 | |
| NUMBER_OF_MEMBER = 100 | |
| NUMBER_OF_TRIAL = 10_000_000 | |
| members = Array.new(NUMBER_OF_MEMBER) { |i| INITIAL_COINS } | |
| NUMBER_OF_TRIAL.times do |n| | |
| if n % 100_000 == 0 | |
| puts n.to_s + "\t" + members.map(&:to_s).join("\t") | |
| end |
| module Monoid exposing (..) | |
| import Html exposing (text) | |
| main = text <| toString <| sum [1,2,3] | |
| type alias Monoid a = | |
| { empty : a | |
| , append : a -> a -> a | |
| } |
https://sk-design-labo.connpass.com/event/53851/
| import Html exposing (..) | |
| import Html.Attributes as A exposing (type_, value, min, max, step, disabled) | |
| import Html.Events exposing (onInput) | |
| import Json.Decode exposing (decodeString, float) | |
| main = | |
| Html.beginnerProgram | |
| { model = initialModel | |
| , view = view | |
| , update = update |
| module BubbleSort where | |
| -- | | |
| -- Bubble Sort | |
| -- | |
| -- >>> bubbleSort [1,2,3] | |
| -- [1,2,3] | |
| -- | |
| -- >>> bubbleSort [2,3,1] | |
| -- [1,2,3] |
| *.txt diff=sjis |