Skip to content

Instantly share code, notes, and snippets.

View RO_2021_Q3.rb
class Race
def initialize(racers)
@racers = racers.map { |rc| rc.new }
results = @racers.map { |_r| 1 }
@racers.each do |r|
r.set_turn_results(1, 1, results)
end
@goaled = []
end
@parrot-studio
parrot-studio / Arcana.ts
Last active Nov 26, 2019
ccptsのドメイン設計
View Arcana.ts
// 値オブジェクト:アルカナ
export default class Arcana {
private _arcanaCode: string
private _cost: number
constructor(code: string, cost: number) {
this._arcanaCode = code
if (this.cost >= 0) {
this._cost = cost
@parrot-studio
parrot-studio / BF.kt
Last active Apr 11, 2019
BrainF**k interpreter by Kotlin
View BF.kt
object BF {
private val commends = mapOf(
'>' to "pinc",
'<' to "pdec",
'+' to "inc",
'-' to "dec",
'.' to "out",
',' to "inp",
'[' to "jmp",
']' to "ret"
View logics_skill_4005.rb
# https://paiza.jp/logic_summoner/challenges/logics_skill_4005
def mark(board, table, w, max, color, base, ind)
return if table[ind]
return unless color == board[ind]
r = ind % w
table[ind] = base
mark(board, table, w, max, color, base, ind - 1) if r > 0 # left
mark(board, table, w, max, color, base, ind + 1) if r < w - 1 # right
mark(board, table, w, max, color, base, ind - w) if ind >= w # up
@parrot-studio
parrot-studio / bf.exs
Last active Jan 17, 2017
BrainF**k interpreter by Elixir
View bf.exs
defmodule BF do
@cmap %{
">" => :pinc,
"<" => :pdec,
"+" => :inc,
"-" => :dec,
"." => :out,
"," => :inp,
"[" => :jmp,
"]" => :ret
View ando
https://paiza.jp/poh/ando
glasses
https://paiza.jp/poh/ando/share/f872136d
santa
https://paiza.jp/poh/ando/share/b8c73b8b
swimwear
https://paiza.jp/poh/ando/share/841f1803
View joshibato
https://paiza.jp/poh/joshibato/
kirishima.rb
https://paiza.jp/poh/joshibato/kirishima/result/4d6681fb
rio.rb
https://paiza.jp/poh/joshibato/tsubame/result/f494a598
tsubame.rb
https://paiza.jp/poh/joshibato/tsubame/result/f494a598