| module HackOS | |
| class Panel < Hokusai::Block | |
| template <<~EOF | |
| [template] | |
| clipped { | |
| @tap="on_tapdown" | |
| @drag="on_taphold" | |
| @taphold="on_taphold" | |
| @swipe="on_swipe" | |
| @taprelease="on_taprelease" |
| module HackOS | |
| class MovingIcon < Hokusai::Block | |
| template <<~EOF | |
| [template] | |
| virtual | |
| EOF | |
| computed! :moving | |
| computed! :name | |
| computed! :width |
| class ACamera < Hokusai::Block | |
| template <<~EOF | |
| [template] | |
| empty { @click="add_filter" } | |
| EOF | |
| uses(empty: Hokusai::Blocks::Empty) | |
| attr_accessor :lw, :lh, :texture, :camera |
| class Char < Hokusai::Block | |
| template do | |
| child(Hokusai::Blocks::Empty) do | |
| on(:keydown) do |event| | |
| move(event) | |
| end | |
| end | |
| end | |
| # 68x68 blocks |
| gemspec("counter-app") do |config| | |
| gem path: "../mruby" | |
| gem path: "../hokusai-pocket" | |
| end |
| # Proposed DSL API | |
| # Declare a gemspec with an ID | |
| # | |
| # conf contains properties about the build | |
| gemspec "mruby-hokusai-pocket" do |conf| | |
| conf.version = "0.1.0" | |
| conf.author = "skinnyjames" | |
| #..etc |
You will need Raylib to run this example: https://github.com/raysan5/raylib?tab=readme-ov-file#build-and-installation
To run, you will need to set the RAYLIB_PATH env, eg:
gem install hokusai-zero -v 0.2.7
# install raylib ...
RAYLIB_PATH=libraylib.dylib ruby --yjit squares.rbThe strategy is about representing the initial state of a file, adding patches (which add changes to a file), and the reconstruction of a file from a given patch's ancestor tree is about calculating offsets.
A rough schema looks like...
// the initial file
CREATE TABLE IF NOT EXISTS files (
id INTEGER PRIMARY KEY AUTOINCREMENT,
directory INTEGER CHECK( directory in (0, 1) ) NOT NULL DEFAULT 0,
content BLOB DEFAULT NULL,
added_on INTEGER NOT NULL,The strategy is about representing the initial state of a file, adding patches (which add changes to a file), and the reconstruction of a file from a given patch's ancestor tree is about calculating offsets.
A rough schema looks like...
// the initial file
CREATE TABLE IF NOT EXISTS files (
id INTEGER PRIMARY KEY AUTOINCREMENT,
directory INTEGER CHECK( directory in (0, 1) ) NOT NULL DEFAULT 0,
content BLOB DEFAULT NULL,
added_on INTEGER NOT NULL,