Ismael-VC / learning-uxn-uf-by-making-a-game

"Learning Forth by Programming a Game - Bill Ragsdale" in UF and UXN Tal.

Home Page:https://youtu.be/QO3fiIhRuOg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learning UXN Tal and UF Forth by making a game.

This repository contains ported code from the video tutorial "Learning Forth by Programming a Game - Bill Ragsdale" in UXN Tal (.tal) and UF Forth (.fth).

UXN

Installation

$ git clone https://git.sr.ht/\~rabbits/uxn
$ cd uxn
$ mkdir ~/bin
$ sudo apt install libsdl2-dev wget  # Ubuntu
$ pkg install sdl2 wget              # Android Termux
$ ./build.sh --install               # copies executables to ~/bin
$ cp boot.rom ~/roms
$ export PATH=~/bin:$PATH
$ cd ~/.config/micro
$ mkdir syntax && cd syntax
$ # Setup UXN Tal syntax highlighting for the micro editor.
$ wget https://hacklab.nilfm.cc/dotfiles/raw/main/micro/syntax/uxn.yaml

Updating

$ cd uxn
$ git pull
$ ./build.sh --install
$ cp boot.rom ~/roms

Configuration

# ~/.zshrc
alias asm="~/bin/uxnasm"            # assembler
alias cli="~/bin/uxncli"            # command line interface
alias emu="~/bin/uxnemu"            # graphical emulator
alias uxn="uxnemu ~/roms/boot.rom"  # Varvara's Potato OS

export PATH=~/bin:$PATH

Workflow

$ micro file-name.tal
$ uxnasm file-name.tal fil-name.rom && uxncli file-name.rom
$ uxncli rom-name.rom &> file-name.txt

UF

Installation

$ git clone https://gitlab.com/b2495/uf
$ cd uf
$ uxnasm kernel.tal kernel.rom
$ uxncli kernel.rom <uf.f
$ cp ufx.rom uf.rom uf0.rom ~/roms
$ sudo apt install rlwrap                 # CLI REPL readline editing support

Updating

$ cd uf
$ git pull
$ uxnasm kernel.tal kernel.rom
$ uxncli kernel.rom <uf.f
$ cp ufx.rom uf.rom uf0.rom ~/roms

Configuration

# ~/.zshrc
alias ufx="uxnemu -2x ~/roms/ufx.rom"     # core + uxn + graphical
alias uf="rlwrap uxncli ~/roms/uf.rom"    # core + uxn
alias ufo="rlwrap uxncli ~/roms/uf0.rom"  # core

Updating configuration

$ micro ~/zshrc    # do edits
$ source ~/.zshrc  # reload configs

Workflow

$ micro file-name.fth  # edit code
$ uf < file-name.fth   # give uf a file to read as code (exits when finished though!)
$ uf                   # repl + copy paste code

About

"Learning Forth by Programming a Game - Bill Ragsdale" in UF and UXN Tal.

https://youtu.be/QO3fiIhRuOg


Languages

Language:Python 71.7%Language:Forth 28.3%