To run this you need node and the PEG.js module installed.
To create the parser.js file, run:
pegjs grammar.peg parser.js
Now to compile the xmaslang source, run:
node parser.js program.xmas > programm.js
(dolist (x '(:hunchentoot :cl-who :parenscript :cl-fad)) | |
(ql:quickload x)) | |
(defpackage "EXPERIMENTS" | |
(:use "COMMON-LISP" "HUNCHENTOOT" "CL-WHO" "PARENSCRIPT" "CL-FAD")) | |
(in-package "EXPERIMENTS") |
(defun fetch-and-spit-player (idx) | |
(let ((path (format nil "C:\\temp\\fpl\\~A.json" idx))) | |
(with-open-file (fs path :direction :output | |
:if-exists :overwrite | |
:if-does-not-exist :create) | |
(format t "Output: ~A~%" path) | |
(format fs (flexi-streams:octets-to-string | |
(drakma:http-request | |
(format nil "http://fantasy.premierleague.com/web/api/elements/~A/" idx)) | |
:external-format :UTF-8))))) |
(ql:quickload :cl-redis) | |
(redis:connect :port 7777) | |
(red:select 9) | |
(defvar *start* 201603231200) | |
(defvar *end* 201603231259) | |
(defvar *bu-names* '( |
(defun mapcn (chars nums string) | |
(loop as char across string | |
as i = (position char chars) | |
collect (and i (nth i nums)))) | |
(defun parse-roman (R) | |
(loop with nums = (mapcn "IVXLCDM" '(1 5 10 50 100 500 1000) R) | |
as (A B) on nums if A sum (if (and B (< A B)) (- A) A))) | |
(defun +roman (&rest rx) |
(in-package :cl-user) | |
(defpackage :sms | |
(:documentation | |
"A simple package to send SMS using LINK Mobility") | |
(:use :cl) | |
(:import-from :drakma :http-request) | |
(:import-from :cl-who :with-html-output-to-string :str :esc) | |
(:export :<gateway> | |
:send-sms)) | |
(in-package :sms) |
#lang racket | |
;; Author: Torbjørn Marø | |
;; Inspired by Peter Sessions REVERSE game | |
;; as published in 'BASIC Computer Games' (1978) | |
;; http://www.atariarchives.org/basicgames/showpage.php?page=135 | |
(displayln "Welcome to REVERSE -- A Game of Skill! ") | |
(newline) | |
(displayln "To win, all you have to do is arrange a list ") |
(use srfi-13 extras) | |
(printf #<<EOF | |
KINEMA | |
Adaption of BASIC computer game from 1978 | |
EOF | |
) |
(use srfi-13 extras) | |
(define header #<<EOF | |
-------------------------------------------------------------------- | |
WORD | |
Adaption of original game in BASIC by Charles Reid of Lexington High | |
School, Massachusetts. Scheme version by Torbjørn Marø, 2014. | |
-------------------------------------------------------------------- | |
I am thinking of a word -- you guess it. I will give you clues to |
To run this you need node and the PEG.js module installed.
To create the parser.js file, run:
pegjs grammar.peg parser.js
Now to compile the xmaslang source, run:
node parser.js program.xmas > programm.js
var encryption = function() { | |
// Works with ASCII chars from 32 (space) | |
// to 248 (å). | |
var shiftCharCode = function(code, shift) { | |
if (shift < 0) shift += (248 - 32 + 1) | |
return 32 + (((code - 32) + shift) % (248 - 32 + 1)); | |
}; |