Skip to content

Instantly share code, notes, and snippets.

View basp's full-sized avatar
🏠
Working from home

Bas Pennings basp

🏠
Working from home
View GitHub Profile
@basp
basp / dredge.md
Last active April 26, 2023 19:27
Dredge - The Guide

Tips

Below is a general collection of tips that are more or less ordered in relevance for new players.

  • Use the spyglass that you have from the beginning of the game. Looking around with it does not cost any time. It is a great tool for looking for new or specific fish.
  • Try to wake up early. Generally it is safe to wake up at or after 04:30. This will give you a little bit of extra time for the day. It will also give you a extra (but brief) chance to spot night fish in daylight. Even if you are unable to catch them you can at least learn where the school is.
  • Equipment does not have to be placed in a way that makes sense visually or logically. You can orient them any way you want, use different engine combinations etc. The game won't care how it is oriented on your ship. If the game allows it it will fly no matter how silly it looks. Don't try to make your ship beautiful, it's a tool, not a Barbie.
  • Having multiple engines instead of one very big one can be beneficial, especially
PS D:\basp\kath\src\Kath> dotnet run
I am Kath (a prototype) Joy-like programming langauge that can be embedded
in a .NET application.
> I am named after Kathleen Rita Antonelli who was one of the original
> crew that programmed the ENIAC.
> Joy is a purely functional programming language that was produced by
> Manfred von Thun of La Trobe University in Melbourne, Australia.
@basp
basp / Monster.md
Last active February 24, 2023 18:37
The Monster

We could just evaluate step internally on the interpreter but that wouldn't be much fun. Instead we can also implement it by unwrapping it onto the interpreter queue. This gives some neat trace output.

In this case the command is:

xil> [1 2 3 4 5 6] [dup *] step.

This will take the list [1..6] and execute the program [dup *] for each element. The result of this execution is left on the stack. The program [dup *] duplicates the value on top of the stack and then performs a multiplication operation using the top two items on the stack. This is essentialy a square operation. So after executing this command we expect all the squares of the elements in the list to be on the stack.

@basp
basp / Example01.xil
Created February 22, 2023 23:48
Zapping
PS D:\basp\xil2\src\Xil2> dotnet run
: 3 2 + 3 2 + 3 2 + * .
25 <- top
5 <- bottom
: 3 2 + 3 2 + 1 2 3 4 3 2 + .
5 <- top
4
3
2
1
@basp
basp / Tiny.cs
Last active January 25, 2023 23:56
Tiny virtual machine (Tiny VM)
namespace Hack.Hardware;
internal enum CommandType
{
None,
Address,
Computation,
}
public class Tiny
import Phaser from '../lib/phaser.js'
export default class Example3 extends Phaser.Scene
{
constructor()
{
super('game');
}
preload()
@basp
basp / sugar.md
Last active July 31, 2020 15:54
Syntactic Sugar

Introduction

Programming is about building up bigger things from smaller things. It's also a game of abstraction and this is the fine line that any developer needs to tread.

An abstraction usually boils down to taking one or more components of software and defining a layer that is more safe or convenient to use for the outside world (which we call client of the code).

In the world of programming, there is usually three aspects to make something happen:

  • The client (also known as the invoker)
@basp
basp / raket-otp-ish.rkt
Created October 22, 2019 13:11
Racket OTP-ish
#lang racket
(define (handle-cast req)
(displayln "cast"))
(define (handle-call req)
(displayln "call"))
(define (loop)
(match (thread-receive)
@basp
basp / rt.rkt
Last active October 10, 2019 17:56
Very basic task queue
#lang racket
(struct task (proc))
(struct delayed-task (start-time proc))
(define (start-immediate-task proc)
(queue (task proc)))
(define (delayed-task-from-now sec proc)
(queue (delayed-task (+ (current-seconds) sec) proc)))
@basp
basp / mini-moo..rkt
Created October 7, 2019 15:30
Mini MOO
#lang racket
(define clients (make-hasheq))
(struct socket (in out) #:transparent)
(define (serve port-no)
(define listener (tcp-listen port-no 5 #t))
(define (loop)
(accept-and-handle listener)