Skip to content

Instantly share code, notes, and snippets.

Eisuke Kuwahata mather

  • Miyazaki, Japan
Block or report user

Report or block mather

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fizzbuzzdazz.py
class ModuloTranslation:
"""
割り算のあまり(modulo)を文字列に変換するクラス
"""
def __init__(self, modulo, to_string):
self.modulo = modulo
self.to_string = to_string
def translate(self, n):
View exercise.md

準備

fizzbuzz.py の内容をコピーしてローカルに保存し、以下のコマンドで実行可能であることを確認しましょう。

$ python fizzbuzz.py

課題

@mather
mather / Makefile
Created Oct 2, 2018
Elm 0.19でindex.htmlとdebug.htmlを生成するMakefileの典型例
View Makefile
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
@mather
mather / reverse.sh
Last active Mar 20, 2018
引数を反転させる関数(イマイチ)
View reverse.sh
#!/bin/bash
set -e
reverse () {
local COUNT
COUNT=$#
local PARAMS
PARAMS=("$@")
@mather
mather / pass_coin_randomly.rb
Created Jan 11, 2018
ランダム選ばれた二人がコインを渡し合うとどうなるか
View pass_coin_randomly.rb
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
@mather
mather / monoid.elm
Last active Nov 15, 2017
ElmでMonoidを作ってみた?
View monoid.elm
module Monoid exposing (..)
import Html exposing (text)
main = text <| toString <| sum [1,2,3]
type alias Monoid a =
{ empty : a
, append : a -> a -> a
}
@mather
mather / README.md
Created Apr 16, 2017
南九州ソフトウェア設計Labo vol.2 ハンズオン課題
View README.md

南九州ソフトウェア設計ハンズオン

https://sk-design-labo.connpass.com/event/53851/

課題

  • オブジェクト指向
  • ピザを購入する流れを記述
    • 1500円のピザを購入
    • -800円のキャンペーンが適用されたりされなかったり
@mather
mather / BMI.elm
Created Nov 29, 2016
BMI計算機 by Elm 0.18
View BMI.elm
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
@mather
mather / bubble_sort.hs
Last active Apr 27, 2016
バブルソート in Haskell
View bubble_sort.hs
module BubbleSort where
-- |
-- Bubble Sort
--
-- >>> bubbleSort [1,2,3]
-- [1,2,3]
--
-- >>> bubbleSort [2,3,1]
-- [1,2,3]
@mather
mather / .gitattributes
Last active May 18, 2018
git diff や git show で複数のエンコードのファイルを扱う ref: https://qiita.com/mather314/items/a6b4bad59e2edd659dd4
View .gitattributes
*.txt diff=sjis
You can’t perform that action at this time.