Skip to content

Instantly share code, notes, and snippets.

@ibrahimsag
ibrahimsag / audio.js
Created March 5, 2016 13:42
rxjs audio
import Rx from 'rx';
const eventNames = [
'canplay', 'play', 'pause', 'ended', 'error',
'timeupdate', 'progress', 'seeking', 'seeked', 'loadedMetaData'
];
export default class Audio {
constructor() {
this.subjects = {
var CELL_SIZE = 30,
MAP_SIZE = 20,
VISUAL_FRAME_COUNT = 10,
INFINITY = Infinity,
MAP = [
[2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
% add this line to somewhere in the source file
it:- it(Message, P), (call(P)-> write('\x1b[32;1mpassed\x1b[0m');write('\x1b[31;1mfailed\x1b[0m')), write(' '),write(Message), nl, fail.
% add ass many of this line as you need
% it('<message>', <expression>).
% expression is the thing you want to test that is supposed to be provable if your code works fine.
% message is the description of the thing you want to test..
it('Ayse is Ali's mother', mom(ayse, ali)).
it('Osman is not Ali's mother', \+ mom(osman, ali)).