Skip to content

Instantly share code, notes, and snippets.

View Joelbyte's full-sized avatar

Victor Lagerkvist Joelbyte

View GitHub Profile
@Joelbyte
Joelbyte / basic.pl
Last active January 16, 2021 12:34
BASIC in Prolog
:- use_module(library(assoc)).
%Version 0.1 of PROLOG BASIC.
%Author: Victor Lagerkvist.
%License: not sure, as long as I'm not responsible for anything.
%TODO: comment everything. :(
%Run the program corresponding to StatementList (see the end of this
%file for a concrete example). Try the query: example_program(P),
%run(P, Comp).
@Joelbyte
Joelbyte / l_system.lgt
Created June 19, 2011 11:00
Prolog's Makin' Music - Part 3
:- protocol(l_system).
:- public(rule//1).
:- public(axiom/1).
:- end_protocol.
:- object(algae,
implements(l_system)).
@Joelbyte
Joelbyte / l_system.lgt
Created June 19, 2011 11:00
Prolog's Makin' Music - Part 3
:- protocol(l_system).
:- public(rule//1).
:- public(axiom/1).
:- end_protocol.
:- object(algae,
implements(l_system)).
@Joelbyte
Joelbyte / loader.lgt
Created June 4, 2011 11:26
Prolog's Makin' Music - Part 2
:- initialization((
logtalk_load(library(metapredicates_loader)),
logtalk_load(library(types_loader)),
logtalk_load(scales),
logtalk_load(synthesizer),
logtalk_load(wav),
logtalk_load(xenakis)
)).
@Joelbyte
Joelbyte / wav.lgt
Created May 4, 2011 17:32
Prolog's Makin'n Music - Part 1
:- object(wav).
:- public(prepare/1).
:- public(write_audio/2).
num_samples(100000).
num_channels(1).
bits_per_sample(16).
sample_rate(22050).
@Joelbyte
Joelbyte / builder.lgt
Created April 17, 2011 14:04
Bacchus-Bosch - Part 5
:- object(builder).
:- info([
version is 1.0,
author is 'Victor Lagerkvist',
date is 2011/04/14,
comment is 'The object that builds the entities of Bacchus-Bosch.']).
:- public(build/5).
@Joelbyte
Joelbyte / entity.lgt
Created April 3, 2011 14:49
Bacchus-Bosch - Part 4
:- object(property).
:- info([
version is 1.0,
author is 'Victor Lagerkvist',
date is 2011/03/19,
comment is 'A property constitutes the basic behaviours of the objects in Bacchus-Bosch.']).
:- public(update/2).
:- mode(update(+entity, -entity), zero_or_more).
:- info(update/2, [
@Joelbyte
Joelbyte / entity.lgt
Created March 20, 2011 11:25
Bacchus-Bosch - Part 3
:- object(property).
:- info([
version is 1.0,
author is 'Victor Lagerkvist',
date is 2011/03/19,
comment is 'A property constitutes the basic behaviours of the objects in Bacchus-Bosch.']).
:- public(update/2).
:- mode(update(+entity, -entity), zero_or_more).
@Joelbyte
Joelbyte / game.lgt
Created March 9, 2011 16:07
Bacchus-Bosch - Part 2
:- object(game).
:- info([
version is 1.0,
author is 'Victor Lagerkvist',
date is 2011/03/09,
comment is 'The core functionality of Bacchus-Bosch.']).
:- public(init/0).
@Joelbyte
Joelbyte / game.lgt
Created February 28, 2011 16:20
Bacchus-Bosch - part 1
:- object(game).
:- info([
version is 1.0,
author is 'Victor Lagerkvist',
date is 2011/02/28,
comment is 'The core functionality of Bacchus-Bosch.']).
:- public(init/0).