Skip to content

Instantly share code, notes, and snippets.

View ngrislain's full-sized avatar

Nicolas Grislain ngrislain

View GitHub Profile
@ngrislain
ngrislain / InsertionSortList.lean
Created March 13, 2026 07:58
Type-Driven Development: insertion sort with proof (O(n²))
-- Prompt: "Define a basic linked-list of some type α, and a dependent-type
-- SortedList that provides the proof the list is actually sorted with respect to the ordering on α."
namespace SortList
/-- A basic singly-linked list, generic over a type `α`. -/
inductive List (α : Type) where
| nil : List α
| cons : α → List α → List α
deriving Repr
@ngrislain
ngrislain / SortList.lean
Created March 12, 2026 23:34
Type-Driven Development in Lean 4: sorted lists with machine-checked proofs
-- Prompt: "Define a basic linked-list of some type α, and a dependent-type
-- SortedList that provides the proof the list is actually sorted with respect to the ordering on α."
namespace SortList
/-- A basic singly-linked list, generic over a type `α`. -/
inductive List (α : Type) where
| nil : List α
| cons : α → List α → List α
deriving Repr
@ngrislain
ngrislain / adventure.py
Created November 9, 2025 09:18
adventure
import pyxel
WIDTH = 640
HEIGHT = 400
FOCUS = 200
TRANSPARENT_COLOR = 1
BACKGROUND_COLOR = 0
SKY_COLOR = 1
GROUND_COLOR = 3
TEXT_COLOR = 7
@ngrislain
ngrislain / py38-success.ipynb
Last active September 10, 2025 03:46
py38 success.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
docker run --rm -it -v $(pwd):/repository python:3.7 /bin/bash