This file contains hidden or 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
'("KC_W" | |
"KC_ENTER" | |
"KC_K" | |
"KC_ENTER" | |
"KC_F" | |
"KC_ENTER" | |
"KC_B" | |
"KC_ENTER" | |
"KC_3" | |
"KC_QUOTE" |
This file contains hidden or 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
#lang racket | |
(require db/base | |
db/postgresql | |
db/util/datetime | |
db/util/geometry) | |
(struct planet (id location conqueror-id name mine-limit) | |
#:transparent) | |
(struct ship (id player-id fleet-id name |
This file contains hidden or 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
""" | |
This code is in the public domain. | |
""" | |
import unittest | |
def fib_loop(n): | |
x, y = 1, 0 | |
for _ in range(n): |
This file contains hidden or 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
#lang typed/racket | |
(: fib (Exact-Nonnegative-Integer . -> . Exact-Nonnegative-Integer)) | |
(define (fib n) | |
(cond | |
[(< n 2) 1] | |
[else (+ (fib (sub1 n)) | |
(fib (- n 2)))])) | |
I hereby claim:
- I am winny- on github.
- I am winny (https://keybase.io/winny) on keybase.
- I have a public key ASCR9dFI1NIe-EhBhNXCG_9LqyCUAo2tQdPwjoQyt1AR3Ao
To claim this, I am signing this object:
This file contains hidden or 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
#lang racket/gui | |
(define f% | |
(class frame% | |
(super-new) | |
(define/override (on-subwindow-char recv ch) | |
(match (send ch get-key-code) | |
[#\q (send this show #f) #t] | |
[_ (super on-subwindow-char recv ch)])))) |
This file contains hidden or 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
#lang racket | |
(define (is ls) | |
(let loop ([ls ls] [acc '()]) | |
(if (empty? ls) | |
acc | |
(loop (cdr ls) (ins acc (car ls)))))) | |
(define (ins ls elem) | |
(if (or (empty? ls) (< elem (car ls))) |
This file contains hidden or 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 unittest | |
def insertion_sort(iterable): | |
"""Given `iterable`, sort it into a list using insertion sort.""" | |
L = [] | |
iterable = iter(iterable) | |
while True: | |
try: | |
i = next(iterable) | |
except StopIteration: |
This file contains hidden or 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
#lang racket/base | |
(require racket/class | |
racket/contract | |
racket/list | |
racket/string) | |
(provide (all-defined-out)) | |
(define/contract steps exact-positive-integer? 7) |