Instantly share code, notes, and snippets.

🐱

# Kelsey kelsny

🐱
Created July 22, 2023 05:20
WHY DOESNT THIS SHIT WORK
View HELPME.ts
This file contains 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
 import OpeningBook from "../book/dynamic.js"; import { Adversary, Bitboard, Board, GameState, Move, MoveGenerator, Piece, Zobrist } from "../index.js"; import { AdversaryBestMoveConfig } from "./Adversary.js"; const PawnValue = 100; const KnightValue = 300; const BishopValue = 320; const RookValue = 500; const QueenValue = 900;
Created July 16, 2023 00:00
WHAT THE FUCK IS WRONG WITH MY CODE
View ???.ts
This file contains 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
 import { Adversary, Bitboard, Board, GameState, Move, MoveGenerator, Piece } from "../index.js"; const PawnValue = 100; const KnightValue = 300; const BishopValue = 320; const RookValue = 500; const QueenValue = 900; const squareControlledByOpponentPawnPenalty = 350; const capturedPieceValueMultiplier = 10;
Created February 20, 2023 01:32
View 7c3trianglesprobability.ts
This file contains 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
 // 7 points lay equally distanced on a circle. 3 points are chosen at random. What’s the probability that the triangle formed by the 3 points is acute? const points: [x: number, y: number][] = []; for (let i = 0; i < 7; i++) { const angle = Math.PI * 2 * (i / 7); points.push([Math.cos(angle), Math.sin(angle)]); }
Created December 10, 2022 09:37
View rstd-0.0.1.js
This file contains 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
 (()=>{var e={"./node_modules/call-bind/callBound.js":(e,t,r)=>{var n=r("./node_modules/get-intrinsic/index.js"),o=r("./node_modules/call-bind/index.js"),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},"./node_modules/call-bind/index.js":(e,t,r)=>{var n=r("./node_modules/function-bind/index.js"),o=r("./node_modules/get-intrinsic/index.js"),i=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||n.call(s,i),a=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),c=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=u(n,s,arguments);if(a&&l){var r=a(t,"length");r.configurable&&l(t,"length",{value:1+c(0,e.length-(arguments.length-1))})}return t};var p=function(){return u(n,i,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},"./node_modules/deep-equal/index.js":(e,t,r)=>{var n=r("./node_modules/object-keys/index.js"),o=r(
Created December 10, 2022 08:10
View aoc2022day10input.txt
This file contains 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
Last active February 13, 2022 16:31
CodeWars RoboScript Kata Solutions

These are my solutions to the RoboScript series of katas on CodeWars.

This Kata Series is based on a fictional story about a computer scientist and engineer who owns a firm that sells a toy robot called MyRobot which can interpret its own (esoteric) programming language called RoboScript. Naturally, this Kata Series deals with the software side of things (I'm afraid Codewars cannot test your ability to build a physical robot!).

Created November 9, 2021 16:35
Extension of my previous gist specialized for RxJS
View better-rxjs-pipe.ts
This file contains 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 UnaryFunction = (source: T) => R; type Identity = (source: T) => T; type Pipe[] = []> = T extends [] ? R : L extends void ? T extends [(_: infer P) => infer V, ...infer Rest] ? Pipe]>
Last active November 9, 2021 16:13
Arbitrary arity pipe function typings
View pipe.ts
This file contains 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 UnaryFunction = (source: T) => R; type Pipe[] = []> = T extends [] ? R : L extends void ? T extends [(_: infer P) => infer V, ...infer Rest] ? Pipe]> : never[] : T extends [(_: L) => infer V, ...infer Rest]