Skip to content

Instantly share code, notes, and snippets.

View lucwl's full-sized avatar
🔒
Locked in

Luc Wallace lucwl

🔒
Locked in
View GitHub Profile
from card import Card, FACE
from enum import Enum
from itertools import permutations
from enum import Enum
class Hand(Enum):
ROYAL_FLUSH = 1
STRAIGHT_FLUSH = 2
FOUR_OF_A_KIND = 3
func (a *Analyser) Run(ctx context.Context) {
ticker := time.NewTicker(10 * time.Minute)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
source, err := a.dbConn.GetUnratedSource(ctx)
@lucwl
lucwl / Derivative.hs
Created March 29, 2025 12:24
Not finished
data Function
= Var
| Sum Function Function
| Product Function Function
| Const Int
| Ln Function
| Pow Function Function
| Exp Function
| Sin Function
| Cos Function
@lucwl
lucwl / Boolean.hs
Created March 6, 2025 11:02
Incomplete boolean algebra simplification stuff
data Expr
= One
| Zero
| Var
| And Expr Expr
| Or Expr Expr
| Not Expr
deriving (Show)
eval :: Expr -> Expr
def find_sub(arr):
x = arr[0]
for n in arr[1:-1]:
x ^= n
y = arr[-1] # we want x ^ y == 0
diff = y - (x ^ 0)
if diff < 0: # if negative difference, try a different last element
return find_sub([arr[-1], *arr[:-1]])
return diff, y