Skip to content

Instantly share code, notes, and snippets.

View mrryanjohnston's full-sized avatar
😎
Set your status

Ryan Johnston mrryanjohnston

😎
Set your status
View GitHub Profile
@mrryanjohnston
mrryanjohnston / info.txt
Last active April 9, 2024 22:09
Turbo Baker 9001 - A Cookie Clicker Steam Mod
{
"Name": "Turbo Baker 9001",
"ID": "TurboBaker9001",
"Author": "ryjo",
"Description": "A mod that lets you bake any amount of cookies on demand! I made this. ryjo.",
"ModVersion": 1,
"GameVersion": 2.052,
"Date": "04/01/2024",
"Dependencies": [],
"Disabled": 0,
@mrryanjohnston
mrryanjohnston / README.md
Last active August 9, 2024 15:14
Better syntax highlighting for CLIPS in vim in Ubuntu

Slightly better syntax highlighting for CLIPS in vim (in Ubuntu)

Problem

Syntax highlighting is so-so for .clp files. vim, my favorite code editor, detects these filetypes as jess, an unmaintained Rules Engine with a similar syntax to CLIPS.

Adding the jess.vim file to ~/.vim/after/syntax/ and the default.vim file to ~/.vim/colors in your Ubuntu system will provide slightly better highlighting when editing CLIPS files

(deffunction say_hello (?name) do
(format t "Hello, %s!" ?name))
(deftemplate MAIN::meta-fact
(slot meta-fact)
(slot name))
(defrule MAIN::loop
?nil-meta-fact <- (meta-fact (meta-fact nil))
?announce-meta-fact <- (meta-fact (name ?name))
(not (meta-fact (meta-fact ?announce-meta-fact)))
=>
(println "Meta-fact: " ?name)
; Based on https://markushimmel.de/blog/my-first-verified-imperative-program/
(defrule sum-is-0
(list $? ?first $? ?second $?)
(test (= 0 (+ ?first ?second)))
=>
(println TRUE))
(defrule sum-is-not-0
(not (and
(list $? ?first $? ?second $?)
@mrryanjohnston
mrryanjohnston / README.md
Created August 30, 2025 01:11
CLIPS Blackjack

CLIPS Blackjack

Implementation of the game Blackjack (21) in CLIPS

Usage

Run this from the command line with ./clips -f2 program.bat like so:

$ ./clips -f2 program.bat