Skip to content

Instantly share code, notes, and snippets.

Jerry James jerry-james

View GitHub Profile
View gist:145d80ea4c691805da1496dc5c5b0529
List<Cave> unplacedCaves = ...;
List<Cave> placedCaves = new ArrayList<>();
for(Cave caveToPlace: unplacedCaves) {
scramble(placedCaves);
Cave parent = placedCaves
.stream()
.filter(cave -> cave.hasVacancy())
.findFirst();
parent.linkWith(caveToPlace);
View sewpr.v
Definition relation (X: Type) := X -> X -> Prop.
(* 1.1 *)
Inductive B : Set :=
| t : B
| f : B
| or : B -> B -> B.
Check B.
Check t.
View gist:137374032efe9c0418d3c34570bd734f
#lang racket/gui
(module+ test
(require rackunit))
(define (exact/sqrt n) (inexact->exact (sqrt n)))
(define exact/pi (inexact->exact pi))
(define shape%
(class object%
(init-field origin)
View gist:8a8139b7239069a76c7de3511101e80f
#lang racket
; working thru http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-453.pdf
(require racket/trace)
(module+ test
(require rackunit))
(struct e-quote (value) #:prefab)
(define (atom? e) (not (pair? e)))
View gist:05bd535c7ac1b001aafce38a33f47218
Fixpoint nonzeros (l:natlist) : natlist
match l with
| nil => nil
| h :: t => match h with
| 0 => nonzeros t
| _ => h :: nonzeros t
end
end.
View gist:c13772df99c5059089e146633e2dba38
<Label text="Level" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<ComboBox fx:id="levelComboBox" GridPane.columnIndex="1" GridPane.rowIndex="0">
<value>
<Integer fx:value = "0"/>
</value>
</ComboBox>
<Label text="Strength" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<ComboBox value = "0" fx:id="strengthComboBox" GridPane.columnIndex="1" GridPane.rowIndex="1">
<value>
You can’t perform that action at this time.