Skip to content

Instantly share code, notes, and snippets.

View nogitsune413's full-sized avatar

Nakamura Yusuke nogitsune413

View GitHub Profile
@nogitsune413
nogitsune413 / Javaでオセロ 於 コマンドプロンプト
Last active December 19, 2015 17:48
Javaでオセロを書きました。 きっと動くはず。 CUIで動作します。
import java.util.Scanner;
public class Othello_CUI {
private static final int L = 10,
X = 0,
Y = 1,
EMPTY = 0,
BLACK = 1,
WHITE = 2,
DRAW = 3,
@nogitsune413
nogitsune413 / gist:6378301
Last active December 21, 2015 22:49
Scalaでオセロを書いた。 なるべく再帰を使い、変数を除去するように努めた。 しかし、IOに関しては変数の除去を諦めた。
import scala.io._
object Main {
val L = 10
val X = 0
val Y = 1
val EMPTY = 0
val BLACK = 1
val WHITE = 2
@nogitsune413
nogitsune413 / DivideTest.scala
Last active June 4, 2017 05:41
有理数から循環小数を算出する。 [アルゴリズム]リストによる内部状態の保存、比較 (Scala)
import scala.collection.immutable.Stream.Empty
/**
* 循環小数の検出
* Created by nakam on 2017/05/14.
*/
object DivideTest {
def main(args: Array[String]): Unit = {
@nogitsune413
nogitsune413 / Test.scala
Created May 30, 2017 14:15
フロイドの循環検出法を使って、有理数から循環小数を算出する。(仕掛中)
import scala.annotation.tailrec
/**
* Created by nakam on 2017/05/29.
*/
object Test {
def main(args: Array[String]): Unit = {
val dividend = 9 // 割られる数
val divisor = 74 // 割る数