Skip to content

Instantly share code, notes, and snippets.

View Ravenslofty's full-sized avatar
💭
Black lives matter.

Lofty Ravenslofty

💭
Black lives matter.
View GitHub Profile
265 func Illegal(b *Board) bool {
266 king, err := FindKing(b, 1-b.ToMove)
267 if err != nil {
268 return true
269 }
270
271 return !squareattacked(b, king, b.ToMove)
272 }
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
22.45 1.76 1.76 5933345 0.00 0.00 RecalculateAttacksFromScratch
19.01 3.25 1.49 5429001 0.00 0.00 Eval
11.48 4.15 0.90 __fentry__
8.16 4.79 0.64 13 49.23 409.23 Search
8.16 5.43 0.64 _mcount_private
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Dan Ravensloft <dan.ravensloft@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Dan Ravensloft <dan.ravensloft@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@Ravenslofty
Ravenslofty / fw.py
Last active March 19, 2017 03:21
What is this "readability" you speak of?
from sys import*
o=ord
g=lambda s:print(''.join(map(lambda c:((c,chr(o(c)+65248))[o(c)<127]," ")[c==" "],s)))
if len(argv)>1:g(' '.join(argv[1:]))
else:
while 1:g(input())
function ElectronRVBuilder::SelectVehicle()
{
local rvlist = AIEngineList(VT_ROAD);
rvlist.Valuate(AIEngine.GetCargoType);
rvlist.Valuate(AICargo.HasCargoClass, CC_PASSENGERS);
rvlist.KeepValue(true);
}
q7/5bn1/8/7r/8/3Q4/6R1/3R4 w - -
attacks[east]:
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . 1 1 1 1
. . . . . . . 1
@Ravenslofty
Ravenslofty / Science.txt
Created May 15, 2017 18:05
Me fucking about with history heuristic
Relative history, reducing no values. <--- Default at start
12 33 436 5767502 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Bc5 6. Nb3 Bd6
13 39 778 10078423 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 d5 6. exd5 Nxd5 7. Nxd5
History, reducing peak values. <--- Ed Schroeder's recommendation
12 33 546 6855837 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Bc5 6. Nb3 Bd6
History, reducing no values. <--- "Does this work because it's a signed number, or because it's reducing values?"
Dillinger:
Score of New vs Sungorus: 16 - 71 - 13 [0.225] 100
ELO difference: -215
Ambrosia (w/ tuning code):
Score of New vs Sungorus: 9 - 85 - 6 [0.120] 100
ELO difference: -346
CPW SEE w/ X-rays:
13 26 1406 19519760 1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 Bb4 6. Bg5 h6 7. Nxc6
# 1st move cuts: 251613 total cuts: 405145 percent: 62
CPW SEE w/o X-rays:
13 26 1371 19520299 1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 Bb4 6. Bg5 h6 7. Nxc6
# 1st move cuts: 251613 total cuts: 405145 percent: 62