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
let d = 4 | |
let a = Array.create (d*d) 0 | |
let results = System.Collections.Generic.Dictionary<int,int>() | |
for n=0 to (1<<<d*d)-1 do | |
// make a new a | |
for i=0 to d*d-1 do | |
if ((n &&& (1<<<i)) <> 0) then | |
a.[i] <- 1 |
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
d = 4 | |
0: 16 | |
2: 256 | |
3: 512 | |
4: 1472 | |
5: 4608 | |
6: 7936 | |
7: 11264 | |
8: 13408 | |
9: 11264 |
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
#include "stdafx.h" | |
#include "time.h" | |
#define d 5 | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
time_t t = time(0); | |
int a[d*d], results[d*d+1]; | |
for( int i=0; i<d*d; ++i ) a[i] = 0; |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace Doms | |
{ | |
public class Dom | |
{ | |
public int l; | |
public int r; |
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
Using c extension for JSON. | |
Loaded games: [Domohnoes] | |
RECV 84 bytes from : {"command":"start_game","gametype":"com.danceliquid.domohnoes","nick":"RandomMatch"} | |
RECV 87 bytes from : {"gametype":"com.danceliquid.domohnoes","nick":"F# Doms Player","command":"start_game"} | |
### Turn #1 ######################### | |
SEND 90 bytes to RandomMatch: {"command":"move","state":{"hand":[[0,0],[0,4],[3,3],[0,3],[4,6],[2,3],[1,6]],"board":[]}} | |
RECV 49 bytes from RandomMatch: {"command":"move","action":"play","domino":[0,3]} | |
Validating {:command=>"move", :action=>"play", :domino=>[0, 3]} for RandomMatch vs. RandomMatch @ [] | |
Validating {:command=>"move", :action=>"play", :domino=>[0, 3]} for RandomMatch vs. RandomMatch @ [] | |
### Turn #2 ######################### |
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
Using c extension for JSON. | |
Loaded games: [Domohnoes] | |
RECV 84 bytes from : {"command":"start_game","gametype":"com.danceliquid.domohnoes","nick":"RandomMatch"} | |
RECV 87 bytes from : {"gametype":"com.danceliquid.domohnoes","command":"start_game","nick":"F# Doms Player"} | |
### Turn #1 ######################### | |
SEND 90 bytes to RandomMatch: {"command":"move","state":{"hand":[[0,1],[5,6],[0,4],[6,6],[1,2],[4,4],[1,1]],"board":[]}} | |
RECV 49 bytes from RandomMatch: {"command":"move","action":"play","domino":[1,1]} | |
### Turn #2 ######################### | |
SEND 95 bytes to F# Doms Player: {"command":"move","state":{"hand":[[4,6],[0,2],[1,4],[0,5],[0,0],[3,4],[3,3]],"board":[[1,1]]}} | |
RECV 63 bytes from F# Doms Player: {"command":"move","action":"play","domino":[1,4],"edge":"back"} |
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
namespace MonsterBrain | |
type turnoption = Doms.TurnOption | |
type MonsterBrain() = | |
let calcCoeff (o:turnoption) = | |
let first = o.board.[0] | |
let last = o.board.[o.board.Count-1] | |
let mutable hasFirst = false | |
let mutable hasLast = false |
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 post( o, f ) | |
{ | |
o.type = "web" | |
$.post("/req", o, f) | |
} | |
function updateeffort(e,o) | |
{ | |
var x = e.pageX - o.offsetLeft; | |
var percent = Math.floor(100*(x/$(o).width())) |
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
// Trigonometry | |
let pi = System.Math.PI | |
let sin t = System.Math.Sin(t) | |
let cos t = System.Math.Cos(t) | |
let asin r = System.Math.Asin(r) | |
let acos r = System.Math.Acos(r) | |
// Linear Algebra | |
type Matrix2x2 = { m11: double; m12: double; | |
m21: double; m22: double; } |
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
(definst fm [carrier 440 divisor 2.0 depth 1.0] | |
(let [modulator (/ carrier divisor) | |
mod-env (env-gen (lin-env 1 0 1)) | |
amp-env (env-gen (lin-env 0 1 1))] | |
(* amp-env | |
(sin-osc (+ carrier | |
(* mod-env (* carrier depth) (sin-osc modulator))))))) | |
; Some of these are more or less interesting | |
(fm) |
OlderNewer