lezy
Jump to navigation
Jump to search
lezy is a joke esolang created by User:Cinnamony. The only command is lezy, which prints out "lezy".
Examples
lezy
This prints out "lezy"
lezy lezy
This prints out "lezylezy"
lezy lezylezy lezy lezy
Whitespace does not matter. This prints out "lezylezylezylezylezy"
lezy
In fact this is a Quine!
Implementations
An implementation in Common Lisp shall be adduced:
(defun skip-whitespaces () "Skips a sequence of zero or more adjacent whitespaces and returns NIL." (declare (special source index)) (loop while (and (< index (length source)) (member (char source index) '(#\Space #\Tab #\Newline) :test #'char=)) do (incf index))) (defun expect-lezy () "Expects the keyword \"lezy\", on confirmation moving the INDEX pointer past it and returning no value; otherwise an error is issued." (declare (special source index)) (let ((next-token (subseq source index (min (+ index 4) (length source))))) (declare (type string next-token)) (if (string= next-token "lezy") (incf index 4) (error "Expected \"lezy\", but encountered ~s." next-token)) (values))) (defun interpret-lezy (source &aux (index 0)) "Interprets the piece of lezy SOURCE code and returns NIL." (declare (special source index) (type string source) (type fixnum index)) (skip-whitespaces) (loop while (< index (length source)) do (skip-whitespaces) (expect-lezy) (format T "lezy") (skip-whitespaces)))
An implementation in C# is also here:
using System; public class Lezy { private static string program = ""; static void Main(string[] args) { int ch; while ((ch = Console.Read()) != -1) { program += Convert.ToChar(ch); } int ip = 0; while (ip < program.Length - 3) { if (program.Substring(ip, 4) == "lezy") { Console.Write("lezy"); ip += 3; } ip++; } } }