This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="myCanvas" width="150" height="200" style="border:1px solid #d3d3d3;"> | |
Your browser does not support the HTML canvas tag. | |
</canvas> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;"> | |
Your browser does not support the HTML canvas tag. | |
</canvas> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BOARD_SIZE = 208 as const; | |
const BOARD_PADDING = 4 as const; | |
const LINE_WIDTH = 8 as const; | |
const LINE_CAP_SIZE = LINE_WIDTH / 2; | |
const CELL_SIZE = 64 as const; | |
const CELL_PADDING = 4 as const; | |
const CELL_CENTER = CELL_SIZE / 2; | |
const COLOR1 = '#FFD103'; | |
const COLOR2 = '#A303FF'; | |
const COLOR3 = '#CCCCCC'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;"> | |
Your browser does not support the HTML canvas tag. | |
</canvas> | |
<script> | |
var c = document.getElementById("myCanvas"); | |
var ctx = c.getContext("2d"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BOARD_SIZE = 208 as const; | |
const BOARD_PADDING = 4 as const; | |
const LINE_WIDTH = 8 as const; | |
const LINE_CAP_SIZE = LINE_WIDTH / 2; | |
const CELL_SIZE = 64 as const; | |
const CELL_PADDING = 4 as const; | |
const CELL_CENTER = CELL_SIZE / 2; | |
const COLOR1 = '#FFD103'; | |
const COLOR2 = '#A303FF'; | |
const COLOR3 = '#CCCCCC'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const [state, send] = useMachine(machine) | |
return ( | |
< div | |
style={{ | |
display: 'grid', | |
gridTemplateColumns: '36px 36px 36px', | |
gridTemplateRows: '36px 36px 36px 36px 36px', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const machine = Machine<Context, Scheme, Event>({ | |
strict: true, | |
initial: 'X', | |
context: DEFAULT_CONTEXT, | |
states: { | |
X: { | |
always: { | |
cond: CONDITIONS.IS_DONE, | |
target: 'DONE', | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Player = 'X' | 'O' | |
type Coordinate = 1 | 2 | 3 | |
type Coordinates = { row: Coordinate; column: Coordinate } | |
type CellState = { kind: 'Playable' } | { kind: 'Played', player: Player } | |
type Cell = Coordinates & { state: CellState } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load ".paket/load/netstandard2.0/Akka.Serialization.Hyperion.fsx" | |
#load ".paket/load/netstandard2.0/Akka.Cluster.Sharding.fsx" | |
#r "packages/Akkling/lib/netstandard2.0/Akkling.dll" | |
#r "packages/Akkling.Persistence/lib/netstandard2.0/Akkling.Persistence.dll" | |
#r "packages/Akkling.Cluster.Sharding/lib/netstandard2.0/Akkling.Cluster.Sharding.dll" | |
open System | |
open System.Threading | |
open Akkling | |
open Akkling.Cluster.Sharding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "packages/Hyperion/lib/netstandard2.0/Hyperion.dll" | |
#r "packages/Newtonsoft.Json/lib/netstandard2.0/Newtonsoft.Json.dll" | |
#r "packages/Akka.Serialization.Hyperion/lib/netstandard2.0/Akka.Serialization.Hyperion.dll" | |
#r "packages/Akka/lib/netstandard2.0/Akka.dll" | |
#r "packages/Akkling/lib/netstandard2.0/Akkling.dll" | |
open System | |
open Akka | |
open Akkling |