Skip to content

Instantly share code, notes, and snippets.

@hpoit
hpoit / Weiqi2.jl
Last active March 5, 2018 15:13
Weiqi2 - 2nd milestone, thanks to MEastwood at Caltech - func neighbors complete and now func liberties complete!
julia> abstract type Stone end
julia> struct Black <: Stone end
julia> struct White <: Stone end
julia> abstract type Emptiness end
julia> struct Empty <: Emptiness end
julia> Base.show(io::IO, ::Empty) = print(io, "·")
julia> Base.show(io::IO, ::Black) = print(io, "⚈")
julia> Base.show(io::IO, ::White) = print(io, "⚆")
@hpoit
hpoit / Weiqi1_milestone.jl
Last active February 8, 2018 01:11
Weiqi1 - milestone
julia> abstract type Stone end
julia> struct Black <: Stone end
julia> struct White <: Stone end
julia> abstract type Emptiness end
julia> struct Empty <: Emptiness end
# julia> Base.show(io::IO, ::Empty) = print(io, "·")
# julia> Base.show(io::IO, ::Black) = print(io, "⚈")
# julia> Base.show(io::IO, ::White) = print(io, "⚆")
@hpoit
hpoit / onREPL
Created January 12, 2018 15:48
running on REPL
Last login: Fri Jan 12 13:47:11 on ttys000
Kevins-MBP:~ Corvus$ exec '/Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia'
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.0 (2017-06-19 13:05 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-apple-darwin13.4.0
@hpoit
hpoit / react beginner tutorial go
Created January 11, 2018 20:45
Game logic for the board game Go
/*
* board.js - Game logic for the board game Go
*/
var Board = function(size) {
this.current_color = Board.BLACK;
this.size = size;
this.board = this.create_board(size);
this.last_move_passed = false;
this.in_atari = false;
this.attempted_suicide = false;
@hpoit
hpoit / temp1
Created January 10, 2018 14:01
temp1
julia> abstract type Stone end
julia> struct Empty <: Stone end
julia> struct Black <: Stone end
julia> struct White <: Stone end
julia> Base.show(io::IO, ::Black) = print(io, "⚈")
julia> Base.show(io::IO, ::White) = print(io, "⚆")
julia> Base.show(io::IO, ::Empty) = print(io, "·")
@hpoit
hpoit / cormullion.jl
Last active January 9, 2018 16:59
go board
abstract type Stone end
struct Empty <: Stone end
struct Black <: Stone end
struct White <: Stone end
Base.show(io::IO, ::Black) = print(io, "⚈")
Base.show(io::IO, ::White) = print(io, "⚆")
Base.show(io::IO, ::Empty) = print(io, "·")
@hpoit
hpoit / go board
Created January 9, 2018 15:48
go board
CellToolbar
In [3]:
abstract type Stone end
struct Empty <: Stone end
struct Black <: Stone end
struct White <: Stone end
Base.show(io::IO, ::Black) = print(io, "⚈")