Skip to content

Instantly share code, notes, and snippets.

View makenowjust's full-sized avatar
㊗️
The IDOLM@STER MILLION LIVE THE ANIMATION

Hiroya Fujinami makenowjust

㊗️
The IDOLM@STER MILLION LIVE THE ANIMATION
View GitHub Profile
@makenowjust
makenowjust / doom.bash
Created July 30, 2026 13:26
DOOM running in pure GNU Bash — one 19MB shell script, no compiled code. DOOM (doomgeneric, GPL-2.0) compiled to WebAssembly by jacobenget/doom.wasm, translated wasm→bash by dewasm (https://github.com/dewasm/dewasm), plus an ANSI truecolor terminal frontend. bash>=5; ~2min boot, ~34s/frame. bash doom.bash
This file has been truncated, but you can view the full file.
#!/usr/bin/env bash
#
# doom.bash — DOOM, running in pure GNU Bash. No compiled code, no dependencies.
#
# This one file contains two things:
# 1. The 1993 DOOM engine (via doomgeneric), compiled to a WebAssembly module
# by jacobenget/doom.wasm v0.1.0 with the DOOM shareware WAD embedded, then
# translated from WebAssembly into Bash source by dewasm
# (https://github.com/dewasm/dewasm — the same wasm binary also runs there
# as pure Go, Java, Ruby, and Python; see examples/doom).
# frozen_string_literal: true
require 'set'
# # KiriMochi: A SAT Solver Written in Ruby
#
# KiriMochi is a SAT solver written in Ruby. It is based on [MiniSAT](http://minisat.se),
# [Glucose](https://www.labri.fr/perso/lsimon/research/glucose/), and [Gophersat](https://github.com/crillab/gophersat),
# but the implementation is simpler than theirs and easy to understand.
# It implements modern techniques in SAT solving, including
require "bigdecimal"
require "bigdecimal/math"
def measure(name, &block)
s = Process.clock_gettime(Process::CLOCK_MONOTONIC)
r = block.call
t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
time = t - s
STDERR.puts "#{name}: #{time} s"
// An implementation of the RPNI (Regular Positive and Negative Inference) algorithm.
import scala.annotation.tailrec
import scala.collection.mutable
import scala.math.Ordering.Implicits.seqOrdering
import scala.util.boundary
final case class Dfa[Q, A](
initialState: Q,
acceptStateSet: Set[Q],
// This is an implementation of the MAT* algorithm in Scala 3.
//
// The MAT* algorithm is a learning algorithm for symbolic finite automata, proposed by
// George Argyros and Loris D'Antoni, "The Learnability of Symbolic Automata"
// https://doi.org/10.1007/978-3-319-96145-3_23.
import scala.annotation.tailrec
import scala.util.hashing.MurmurHash3
/** `BoolAlg` represents an effective Boolean algebra on the domain `D`.
// This is an implementation of the Λ* algorithm in Scala 3.
//
// The Λ* algorithm is a learning algorithm for symbolic automata, proposed by
// Samuel Drews and Loris D'Antoni (2017), "Learning Symbolic Automata"
// https://doi.org/10.1007/978-3-662-54577-5_10.
import scala.collection.mutable
/** `BoolAlg` represents an effective Boolean algebra on the domain `D`.
*
$b = []
def op_proto(version)
$b.concat([0x80, version])
end
def op_global(mod, name)
$b.concat("c#{mod}\n#{name}\n".unpack("C*"))
end
import scala.util.boundary
import scala.collection.mutable
import scala.compiletime.ops.double
import scala.annotation.tailrec
final case class Mealy[Q, I, O](
initial: Q,
transition: Map[(Q, I), (O, Q)]
):
type State = Q
// kv.scala - an implementation of the Kearns & Vazirani algorithm
import scala.annotation.tailrec
import scala.collection.mutable
import scala.compiletime.ops.double
/** A type for states. */
type Q = String
/** A deterministic finite-state automaton (DFA). */
import { Octokit } from 'octokit';
const { rest: github } = new Octokit();
const OWNER = 'makenowjust-labs';
const REPO = 'recheck';
const BRANCH = 'main';
const STATUS = 'success';
const WORKFLOW_ID = 'main.yml';
const PER_PAGE = 100;