Skip to content

Instantly share code, notes, and snippets.

View BlueRayi's full-sized avatar

ブルーレヰ BlueRayi

View GitHub Profile
@BlueRayi
BlueRayi / game_simulation.py
Created October 11, 2019 04:48
ゲームのシミュレーション
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import random
from pathlib import Path
@BlueRayi
BlueRayi / Complex.swift
Last active September 11, 2018 11:41
拡張複素数構造体(貧弱)
// Neary equal needs this value
fileprivate let ALLOEABLE_ERROR = 1e-12
// Custom operators
prefix operator /
infix operator **: MultiplicationPrecedence
// <Extentions for using float easily>
// Reciprocal
@BlueRayi
BlueRayi / Rational.swift
Created September 10, 2018 11:26
有理数構造体(貧弱)
prefix operator /
public prefix func +(rhs: Rational) -> Rational // これいる?
{
return Rational(rhs.pee, rhs.cue)
}
public prefix func -(rhs: Rational) -> Rational // 反数
{
return Rational(-rhs.pee, rhs.cue)
}