Jason Bonthron

blog

GitHub Game Jam

For the Moon is Hollow and I Have Touched the Sky

This is my game entry to Game Off - GitHub's annual game jam, where participants spend one month creating a game based on a secret theme. The theme for this year’s jam was "MOONSHOT".

For the Moon is Hollow and I Have Touched the Sky

For the Moon is Hollow is an HTML5 game for mobile and desktop. Give it a spin — it's fun!

play the game

Golf like it's 1970

jeff atwood coding horrorMy contribution to Jeff Atwood's (Coding Horror) basic computer games project, in which, classic games from the 1970s are ported to modern languages.

Golf in C# is a text based adventure across 18 holes.

Coding Horror Github

Golf in C#  (source code and executables for linux and windows)

Golf in JavaScript

play the game

Niklaus Wirth's Algorithms + Data Structures 1976

Revisiting Niklaus Wirth's classic book. 45 years later — it remains highly relevant. The code examples are Pascal. Amazingly, the code compiles (unchanged) using the 2020 version of Free Pascal.

In addition to the original Pascal, I'm re-working the algorithms in Scheme, Python, and JavaScript.

Hacking Pascal is old-school !

Pascal — Selection Sort

function straightSelectionSort(a: itemArray): itemArray;
  var
    i, j, k, n: index;
  var
    x: item;

  begin
    n := (length(a) - 1);
    for i := 0 to n do
    begin
      x := a[i];
      k := i;
      for j := i + 1 to n do
        if a[j].key < x.key then
        begin
          k := j;
          x := a[j];
        end;
      a[k] := a[i];
      a[i] := x;
    end;
    Result := a;
  end;

Scheme — Selection Sort

(define (smallest-index lst start-at)
  
  (define (inner x l i j)
    (if (null? l)
        i
        (if (and (> j i) (rec-less-than (car l) x))
            (inner (car l) (cdr l) j (+ j 1))
            (inner x (cdr l) i (+ j 1)))))

  (inner (nth start-at lst) lst start-at 0)
)

(define (selection-sort lst)
  
  (define (inner i l)
    (if (= i (length l))
        l
        (inner (+ i 1) (swap-list-item l i (smallest-index l i)))))

  (inner 0 lst)
  )

more...

Web Design

Typically, I don't do freelance design anymore. But when "Sticks" -the drummer- asked me to help him with his suitcase drum kits, I couldn't refuse!

LambertvilleSuitcaseDrum.com

lambertville suitcase drum

Automata

Notes and observations on John Hopcroft's Automata Theory, Languages, and Computation.


the set of all strings such that each block of four consecutive symbols contains at least two zeros over the alphabet {0,1}.

more...

Esterel

Lately, I have become fascinated with a language called Esterel. Esterel is one of several "synchronous" languages. Synchronous languages ensure determinism for highly concurrent reactive systems. They have broad industrial applications particularly critical control systems like airplanes. Incredibly the three main synchronous languages: Esterel, Signal, and LUSTRE were invented independently at different universities, but at the same time and in the same country ! (France, early 1980s)

Esterel was designed by Gérard Berry at Inria (the National Institute for Research in Computer Science and Automation).

The fundamental principle on which Esterel is based is called: the synchronous hypothesis that states a system reacts to environmental events in zero time. Furthermore, communication among system components is also instantaneous. The synchronous hypothesis separates the notion of physical time from the execution time of the system, which is largely a side-effect of an implementation.

"This is a brutal but effective way to separate concerns, simplify the semantics, and reconcile concurrency and determinism. It is the interference between physical and implementation time that makes classical asynchronous concurrent programs nondeterministic, difficult to write, and hard to analyze." (Berry)

more...

Flexibility Of Closure

HTML5 puzzle for mobile and desktop: Find a hidden pattern in geometrical configuration.

Flexibility of Closure is the cognitive ability to hold a given visual percept or configuration in mind so as to disembed it from other well defined perceptural material.

play !

EMACS view kill ring

Very simple but extemely useful emacs script for viewing your kill ring.

view-kill  Displays the entire kill ring as a single page of numbered items. Select a number to insert that item into your current buffer. Use <SPACE> to scroll. Note: the length of your kill ring is controlled by the variable 'kill-ring-max'.

Probably the most useful emacs lisp I've ever written.

(defun view-kill ()
  (interactive)
  (save-excursion
    (save-window-excursion
      (let ((working-buffer (current-buffer))
            (new-buffer (get-buffer-create "kill-ring-view"))
            (count 0)
            (custom-map (copy-keymap minibuffer-local-map))
            (selection nil)
            )      
        (unwind-protect
            (progn
              (define-key custom-map " " 'scroll-other-window)
              
              (switch-to-buffer new-buffer t)
              (delete-other-windows)
              
              (dolist (x kill-ring)
                (insert (concat "----- " 
                                (number-to-string count) 
                                " -----"))
                (newline)
                (insert x)
                (newline)
                (newline)
                (setq count (+ count 1))
                )
              (goto-char (point-min))
              
              (let ((choice (read-from-minibuffer "choose: " nil custom-map t nil "x")))
                (and (numberp choice)
                     (< choice count)
                     (progn
                       (set-buffer working-buffer)
                       (insert (nth choice kill-ring))
                       (setq selection choice)
                       ))
                ))
          (kill-buffer new-buffer) ; unwind-protect clean-up form
          )
        selection
        ))))
;; VIEW-KILL

;; Displays the entire kill ring as a single page of numbered items.
;; Select a number to insert that item into your current buffer.
;; Use  to scroll.
;; The length of the kill ring is controlled by the variable `kill-ring-max';

https://www.emacswiki.org/emacs/view-kill.el

EOL