Keystone

From Esolang
Jump to navigation Jump to search

Keystone is an esoteric programming language made by User:AmNow, and was made for the purpose of creating and checking product keys.

Commands

A variable can be declared with name ⇠ value. While loops are declared with w … end, If statements are declared as i … [n …] d (n is else) Checking and generating is done with ch(key,rulelist) and ge(key,rulelist). I/O is pr() and u().

Layout

A layout is defined with [], and looks like this: [###-XXX-&&&] Essentially, # only allows for 0-9, X only allows for A-Z and & allows for both 0-9 and A-Z, - creates sets for rulelists.

Rulelist

A rulelist is defined with {} and looks like this: {(s(1)==(2,3,5,7)),(s(2)+s(1)%7!=1)} “s” references the sets that a layout has. s(1) is the first set, s(1)(1) is the first letter/number in the set.

Programs

Generate a Windows 95 CD key

lay ⇠ [###-#######]
pr(ge(lay,{(s(1)!=(333,444,555,666,777,888,999)),(sum(s(2))%7==0),(s(2)(7)!=0),(s(2)(7)<=7))}))