Page namespace (page_namespace)  0 
Page title (without namespace) (page_title)  Pyramid Scheme 
Full page title (page_prefixedtitle)  Pyramid Scheme 
Old content model (old_content_model)  
New content model (new_content_model)  wikitext 
Old page wikitext, before the edit (no more in use) (old_wikitext)  
New page wikitext, after the edit (new_wikitext)  {{DISPLAYTITLE:Pyramid Scheme}}
{{infobox proglang
name=Pyramid Scheme
paradigms=declarative
author=Conor O'Brien
year=[[:Category:20172017]]
class=[[:Category:Turing completeTuring complete]]
refimpl=[https://github.com/ConorOBrienFoxx/PyramidScheme]
influence=[[Lisp]]
files=<code>.pyr</code>, <code>.pyra</code>
}}
Pyramid Scheme is an [[esoteric programming language]] created by [https://github.com/ConorOBrienFoxx Conor O'Brien] in early 2017. It is a dialect of [[Lisp]], but it uses asciiart pyramid structures as opposed to brackets.
== Entymology ==
The name is a joke on the name of a different Lisp dialect called [https://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme], and its similarity to a (widely frownedupon and illegal) business model called the [https://en.wikipedia.org/wiki/Pyramid_scheme pyramid scheme].
== Sample programs ==
=== If/Else statement ===
The following is an implementation of an ifelse statement in pyramid scheme. It prints if A is 1 for truthy, and 0 if it is falsey
^ ^
/ \ / \
/set\ / \
^^ / ? \
/A\ /1\ ^^
  /!\ / \
^ /out\
/ \ ^
/ ? \ /0\
^^ 
/A\ / \
 /out\
^
/1\

This is equivalent to the lisplike syntax:
(set A 1)
(? (! (? A (out 1))) (out 0))
=== Modulo function ===
Pyramid scheme does not have an implementation of the modulo function. A modulo of a number has to, therefore, be calculated with repeated subtraction. The following implements the ''mod(a,b)'' function:
^ ^ ^ ^
/ \ / \ / \ / \
/set\ /set\ / \ /out\
^^ ^^ / \ ^
/a\ / \ /b\ / \ / \ /a\
 /33 \ /16 \ / loop \ 
  ^^
/ \ / \
/ \ /set\
/ <=> \ ^^
^^ /a\ /\
/ \ / \  ^^
/<=>\ /1 \ /a\ /b\
^^   
/a\ /b\
 
which is equivalent to lisplike:
(set a 33)
(set b 16)
(loop (<=> (<=> a b) 1) (set a ( a b)))
(out a)
== External resources ==
* [https://github.com/ConorOBrienFoxx/PyramidScheme Pyramid Scheme] on GitHub
* [https://tio.run/##rZFBCoQwDEX3PcW/gLTRgh5GBFHBWYiDowtPX22chZVuismir/lJCj/97ks7ffrs143DNDgHNOAIENNSoKBR@1uAmJYGpedtPZMAMS0VKvPRIACfeAcFEeOPNXh041KL4nxVxPJzAeLudZn7RJOhCxWDOLOWa8XVUpW41YjsfcAY7izw/35AEM4d Hello world in Pyramid Scheme] on TIO 
Unified diff of changes made by edit (edit_diff)  @@ 1,0 +1,77 @@
+{{DISPLAYTITLE:Pyramid Scheme}}
+{{infobox proglang
+name=Pyramid Scheme
+paradigms=declarative
+author=Conor O'Brien
+year=[[:Category:20172017]]
+class=[[:Category:Turing completeTuring complete]]
+refimpl=[https://github.com/ConorOBrienFoxx/PyramidScheme]
+influence=[[Lisp]]
+files=<code>.pyr</code>, <code>.pyra</code>
+}}
+
+Pyramid Scheme is an [[esoteric programming language]] created by [https://github.com/ConorOBrienFoxx Conor O'Brien] in early 2017. It is a dialect of [[Lisp]], but it uses asciiart pyramid structures as opposed to brackets.
+
+== Entymology ==
+
+The name is a joke on the name of a different Lisp dialect called [https://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme], and its similarity to a (widely frownedupon and illegal) business model called the [https://en.wikipedia.org/wiki/Pyramid_scheme pyramid scheme].
+
+== Sample programs ==
+
+=== If/Else statement ===
+
+The following is an implementation of an ifelse statement in pyramid scheme. It prints if A is 1 for truthy, and 0 if it is falsey
+
+ ^ ^
+ / \ / \
+ /set\ / \
+ ^^ / ? \
+ /A\ /1\ ^^
+   /!\ / \
+ ^ /out\
+ / \ ^
+ / ? \ /0\
+ ^^ 
+ /A\ / \
+  /out\
+ ^
+ /1\
+ 
+
+This is equivalent to the lisplike syntax:
+
+ (set A 1)
+ (? (! (? A (out 1))) (out 0))
+
+=== Modulo function ===
+
+Pyramid scheme does not have an implementation of the modulo function. A modulo of a number has to, therefore, be calculated with repeated subtraction. The following implements the ''mod(a,b)'' function:
+
+ ^ ^ ^ ^
+ / \ / \ / \ / \
+ /set\ /set\ / \ /out\
+ ^^ ^^ / \ ^
+ /a\ / \ /b\ / \ / \ /a\
+  /33 \ /16 \ / loop \ 
+   ^^
+ / \ / \
+ / \ /set\
+ / <=> \ ^^
+ ^^ /a\ /\
+ / \ / \  ^^
+ /<=>\ /1 \ /a\ /b\
+ ^^   
+ /a\ /b\
+  
+
+which is equivalent to lisplike:
+
+ (set a 33)
+ (set b 16)
+ (loop (<=> (<=> a b) 1) (set a ( a b)))
+ (out a)
+
+== External resources ==
+
+* [https://github.com/ConorOBrienFoxx/PyramidScheme Pyramid Scheme] on GitHub
+* [https://tio.run/##rZFBCoQwDEX3PcW/gLTRgh5GBFHBWYiDowtPX22chZVuismir/lJCj/97ks7ffrs143DNDgHNOAIENNSoKBR@1uAmJYGpedtPZMAMS0VKvPRIACfeAcFEeOPNXh041KL4nxVxPJzAeLudZn7RJOhCxWDOLOWa8XVUpW41YjsfcAY7izw/35AEM4d Hello world in Pyramid Scheme] on TIO

Lines added in edit (added_lines)  {{DISPLAYTITLE:Pyramid Scheme}}
{{infobox proglang
name=Pyramid Scheme
paradigms=declarative
author=Conor O'Brien
year=[[:Category:20172017]]
class=[[:Category:Turing completeTuring complete]]
refimpl=[https://github.com/ConorOBrienFoxx/PyramidScheme]
influence=[[Lisp]]
files=<code>.pyr</code>, <code>.pyra</code>
}}
Pyramid Scheme is an [[esoteric programming language]] created by [https://github.com/ConorOBrienFoxx Conor O'Brien] in early 2017. It is a dialect of [[Lisp]], but it uses asciiart pyramid structures as opposed to brackets.
== Entymology ==
The name is a joke on the name of a different Lisp dialect called [https://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme], and its similarity to a (widely frownedupon and illegal) business model called the [https://en.wikipedia.org/wiki/Pyramid_scheme pyramid scheme].
== Sample programs ==
=== If/Else statement ===
The following is an implementation of an ifelse statement in pyramid scheme. It prints if A is 1 for truthy, and 0 if it is falsey
^ ^
/ \ / \
/set\ / \
^^ / ? \
/A\ /1\ ^^
  /!\ / \
^ /out\
/ \ ^
/ ? \ /0\
^^ 
/A\ / \
 /out\
^
/1\

This is equivalent to the lisplike syntax:
(set A 1)
(? (! (? A (out 1))) (out 0))
=== Modulo function ===
Pyramid scheme does not have an implementation of the modulo function. A modulo of a number has to, therefore, be calculated with repeated subtraction. The following implements the ''mod(a,b)'' function:
^ ^ ^ ^
/ \ / \ / \ / \
/set\ /set\ / \ /out\
^^ ^^ / \ ^
/a\ / \ /b\ / \ / \ /a\
 /33 \ /16 \ / loop \ 
  ^^
/ \ / \
/ \ /set\
/ <=> \ ^^
^^ /a\ /\
/ \ / \  ^^
/<=>\ /1 \ /a\ /b\
^^   
/a\ /b\
 
which is equivalent to lisplike:
(set a 33)
(set b 16)
(loop (<=> (<=> a b) 1) (set a ( a b)))
(out a)
== External resources ==
* [https://github.com/ConorOBrienFoxx/PyramidScheme Pyramid Scheme] on GitHub
* [https://tio.run/##rZFBCoQwDEX3PcW/gLTRgh5GBFHBWYiDowtPX22chZVuismir/lJCj/97ks7ffrs143DNDgHNOAIENNSoKBR@1uAmJYGpedtPZMAMS0VKvPRIACfeAcFEeOPNXh041KL4nxVxPJzAeLudZn7RJOhCxWDOLOWa8XVUpW41YjsfcAY7izw/35AEM4d Hello world in Pyramid Scheme] on TIO
