Skip to content

Instantly share code, notes, and snippets.

View RuurdBijlsma's full-sized avatar
🐙

Ruurd Bijlsma RuurdBijlsma

🐙
  • University of Groningen
  • The Netherlands
View GitHub Profile
import EventEmitter from 'events'
export default class AbortSignal extends EventEmitter {
constructor(signal) {
super();
this.signal = signal;
this.aborted = false;
signal.addEventListener('abort', (...e) => this._onAbort(...e));
this.onabort = () => 0
}
package dev.ruurd.vuemusic
import android.annotation.SuppressLint
import android.net.http.SslError
import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.Window
import android.webkit.*
import androidx.appcompat.app.AppCompatActivity
import strformat
import tables
# (matches, color), (bestMove, heuristic)
var transposition = initTable[(int, int), (int, int)]()
func negaMax(matches: int, color: int, tTable: Table[(int, int), (int, int)]): (int, int) =
var key = (matches, color)
if tTable.hasKey(key):
return tTable[key]
import strformat
import tables
# (matches, color), (bestMove, heuristic)
var transposition = initTable[(int, int), (int, int)]()
func negaMax(matches: int, color: int, tTable: Table[(int, int), (int, int)]): (int, int) =
var key = (matches, color)
if tTable.hasKey(key):
return tTable[key]