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
struct wlr_surface *wlr_surface_surface_at(struct wlr_surface *surface, | |
double sx, double sy, double *sub_x, double *sub_y) { | |
// Do stuff | |
} |
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
"""Investigating and implementing MCTS without the complications of the MTG simulator.""" | |
from collections import Counter | |
from copy import deepcopy | |
import math | |
import random | |
import cProfile | |
compose = lambda f: lambda g: lambda *args, **kwds: f(g(*args, **kwds)) |
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
; %n - fp register n | |
; @n - int register n | |
; $n - lit int n | |
initial f32 top, left, bottom, right, 16.0f; | |
final f32 result[256]; | |
ld %0,$0 ; %0 = top | |
ld %1,$1 ; %1 = left | |
ld %2,$2 ; %2 = bottom |
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
data _⊔_is_ : ℕ → ℕ → ℕ → Set where | |
m≥⊔nism : {m n : ℕ} | |
→ n ≤ m | |
--------- | |
→ m ⊔ n is m | |
m≤⊔nisn : {m n : ℕ} | |
→ m ≤ n | |
--------- | |
→ m ⊔ n is n |
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
data ℕ : Set where | |
zero : ℕ | |
suc : ℕ → ℕ | |
{-# BUILTIN NATURAL ℕ #-} | |
data _≤_ : ℕ → ℕ → Set where | |
z≤n : {n : ℕ} | |
------- | |
→ zero ≤ n |
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
DEBUG = True | |
macro ASSERT(e): | |
return \(if DEBUG: | |
if not $e: | |
raise AssertionError($(stringify(e)))) | |
def assert_equal(x, z): | |
# x and z are compared so they must have the same type |
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
# normal macro | |
# \ is ` and $ is , | |
macro assert(e): | |
\(if DEBUG: | |
if not $e: | |
raise AssertionError($(stringify(e))) | |
# control structure macro |
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
# normal macro | |
# \ is ` and $ is , | |
macro assert(e): | |
\(if DEBUG: | |
if not $e: | |
raise AssertionError($(stringify(e))) | |
# control structure macro |
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
data X = X { _y :: Y } | |
data Y = Y1 { _y1 :: Int } | |
| Y2 { _y2 :: String } | |
x1 = X (Y1 0) | |
x2 = X (Y2 "Hello") | |
i1 = x1^.y.y1 -- error ?? | |
i2 = x2^.y.y1 -- error ?? | |
s1 = x1^.y.y2 |
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
def tclass(*argnames, then_do=None): | |
if len(argnames) == 1 and isinstance(argnames[0], dict): | |
argnames = argnames[0] | |
def decorator(cls): | |
def inner_init(self, *args, **kwargs): | |
for argname, arg in zip(argnames, args): | |
self.__setattr__(argname, arg) | |
for argname in list(argnames)[len(args):]: | |
self.__setattr__(argname, argnames[argname]) |