- Not to be confused with Print.
Designed by | User:SpaceByte |
---|---|
Appeared in | 2023 |
Computational class | Finite state automaton |
Major implementations | Implementations |
File extension(s) | none |
pRINT is an esolang by User:SpaceByte, designed not for any form of use, but simply to be as easy to make an interpreter for as possible. This can result in various ways of using the language.
Overview & Interpreter Requirements
In pRINT, the character "p" will print any form of text, however, officially it is used to print "print". This base function qualifies as an interpreter, however, another feature of the language is the "r" command, which will redo all code. However, this is not required in an interpreter.
The ONLY required functionality to be considered an interpreter is 'p' to print "print". However, this print should be on a newline with some exceptions, like a less capable language, something like brainfuck. If you want to, you interpreter can also contain 'w' for "write", if you would like a way to print something without a newline.
Inspiration
pRINT is inspired by many languages, such as brainfuck, ඞlang Hello, Hello++, Hello++++, Hello++++++++, Hello++++++++++++++++, and the coming soon, Hello++++++++++++++++++++++++++++++++
Interpreters
Main Interpreter
Made in C# by User:SpaceByte. Includes all official features.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Program { class Program { public static void Main(string[] args) { Console.WriteLine ("What is your source code?"); string cmds = Console.ReadLine(); int index = 0; while (index < cmds.Length) { char cmd = cmds[index]; switch (cmd) { case 'p': Console.Write("\nprint"); break; case 'w': Console.Write("write"); break; case 'r': index = -1; break; } index++; } } }
Brainfuck interpreter
By User:SpaceByte
Since I am not smart, this sort of does the opposite, it print "print" only when the character, however, it does the base function, and this limitation does not mess with other functionalities, as there are no other functionalities in this interpreter. This is also pretty unoptimized.
,------------------------------------------------------------------------------------------------------[>+[------->++<]>++.++.---------.+++++.++++++.>]
Second Brainfuck Interpreter
I tried again. I messed up, and it ended up not working, however, it DOES print "print", when input is "p", and doesn't print "print", when it's not.
>+<,----------------------------------------------------------------------------------------------------------------[<-]>[>+[------->++<]>++.++.---------.+++++.++++++.>]
NOTE: This is not accurate, as it actually prints 55k+ characters, but this is just the first few characters. When it's not "p", it prints:
�������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ��������������������������������������������������������������������������� �������������������������������������������������������������������������� ����������������������������������������������������������������������������������������������������������������������������������������������������� �������������������������������������������������������������������������� ��������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ����������oqhms
There is also a brainfuck interpreter by User:None1 in here.
Batch Interpreter
@echo off title pRINT Interpreter echo What is your source code? please give it to me... i need the source code, or else I cant execute the program plsplss. set /p inputyourcodehereplsthanksineeditrnsoicanexecutetheummmuhhhhwhatwasitcalledagainohyeahtheoutputforyourcodeintheprintlangokgotitnowimdone= if %inputyourcodehereplsthanksineeditrnsoicanexecutetheummmuhhhhwhatwasitcalledagainohyeahtheoutputforyourcodeintheprintlangokgotitnowimdone%==p ( echo print ) print Program Ended. pause>nul
Java Interpreter
By User:SpaceByte
PORT OF THE C# INTERPRETER
import java.util.Scanner; class HelloWorld { public static void main(String[] args) { System.out.println("What is your source code?"); Scanner scanner = new Scanner(System.in); char[] cmds = scanner.nextLine().toCharArray(); int index = 0; while (index < cmds.length) { char cmd = cmds[index]; switch (cmd) { case 'p': System.out.print("\nprint"); break; case 'w': System.out.print("write"); break; case 'r': index = -1; break; } index++; } } }
C++ Interpreter
#include <iostream> int runcode(std::string code) { for (char c : code) { switch (c) { case 'p': std::cout<<"\nprint"; break; case 'w': std::cout<<"write"; break; default: break; } } return 2147000000; } int main() { std::cout<<"Enter your source code.\n"; std::string code; std::cin>>code; if (code.find("r") != std::string::npos) { while (true) { runcode(code); } } else { runcode(code); } return 2147000000; }
C Interpreter
By User:SpaceByte
this was painful.
This is a ported version of the C++ interpreter.
#include <stdio.h> #include <stdbool.h> int runcode(char code[]) { for (int i = 0; i < sizeof code; i++) { char c = code[i]; switch (c) { case 'p': printf("\nprint"); break; default: break; } } return 2147000000; } int main() { printf("Enter your source code.\n"); char code[] = ""; scanf("%s",code); bool containsR = false; for (int i = 0; i < sizeof code; i++) { char c = code[i]; if (c == 'r') { containsR = true; } } if (containsR) { while (true) { runcode(code); } } else { runcode(code); } return 2147000000; }
HTML Interpreter using inlined html.js
Mascarpone interpreter
Rather than interpreting through input, you must append the pRINT program to the interpreter.
[]v*1[v{^]v*'|<v/}^ Made by: BoundedBeans Commands supported: p, w, i, h Append your pRINT program to this program. This program isn't an interpreter itself, but the interpreter executing it BECOMES a pRINT interpreter Also, I'm trying out a weird sort of comment style here. Pretty much it redefines every character of the current interpreter to a no-op except one that means "restore the original interpreter". Fun fact: This is my first Mascarpone program that does anything useful other than testing features. ----------------------------------------------- ! Remove everything up to and including ! ! this vertical bar character and the program ! ! will work fine ! ----------------------------------------------- ! V |[]v*1[[tnirp ]$......$]v*'p<[[etirw]$.....$]v*'w<[,$]v*'i<[[!dlrow ,olleH]$.............$]v*'h<^
Thue interpreter
_p::=print_ ::= _ppp
_
followed by the program is in the third line, in this case, the program is ppp
. p
doesn't print a line feed. The output, followed by an underscore, is stored in the state string. When it encounters a character that isn't p
, execution stops, for example, if the program is pqp
the output is print_qp
.
Semi-Golfed Perl implementation
This implementation was made by BoundedBeans, who is not experienced at Perl or golfing it. So, this could probably be improved.
sub{$_[0]->($_[0],$_[1])}->(sub{@c=split//m,$_[1];for$d(@c){$d eq'r'?$_[0]->($_[0],$_[1]):print{'p',"\nprint",'w',"write"}->{$d}}},<STDIN>)
(139 bytes)
FerNANDo implementation
By BoundedBeans. This was actually really tricky to program, because FerNANDo has no way to jump forward, and thus no way to conditionally print or not print, and "\nprint" has one more character than "write". The way I came up with was to make a section of code (in between the one word "fine" lines) that either runs once or twice, with a different configuration of two variables for "\n", "p", and "w" so that gates could modify the variables containing the bits to be printed.
As stated in the code, this does not support the r command (it only supports p and w).
pRINT in ferNANDo does not work with r command pRINT fine command command fine fine fine fine fancy fine fine like command command like like fine such fine fine fine fancy command like command fine fine fine fine but command command one one one fine one one and one one one and also one too and one one and one and also one and one one command but one but zero and one one but also one and command one one one pRINT in ferNANDo does not work with r command pRINT
Examples
p
w
write
pw
printwrite
wp
write print
pr
print print print print
(infinite)
Command Concepts
Although pRINT only required the 'p' command, to be considered a true interpreter, here are some concepts, not officially implemented.
These commands are implemented at pRINT/Concept Interpreter
i
Take input, however, does nothing with said input.
h
Hello, World!
b
Bye. End the program.
t
Print the chemical composition of titin. This might print
methionylthreonylthreonylglutaminylalanylprolylthreonylphenylalanylthreonylglutaminylprolylleucylglutaminylserylvalylvalylvalylleucylglutamylglycylserylthreonylalanylthreonylphenylalanylglutamylalanylhistidylisoleucylserylglycylphenylalanylprolylvalylprolylglutamylvalylseryltryptophylphenylalanylarginylaspartylglycylglutaminylvalylisoleucylserylthreonylserylthreonylleucylprolylglycylvalylglutaminylisoleucylserylphenylalanylserylaspartylglycylarginylalanyllysylleucylthreonylisoleucylprolylalanylvalylthreonyllysylalanylasparaginylserylglycylarginyltyrosylserylleucyllysylalanylthreonylasparaginylglycylserylglycylglutaminylalanylthreonylserylthreonylalanylglutamylleucylleucylvalyllysylalanylglutamylthreonylalanylprolylprolylasparaginylphenylalanylvalylglutaminylarginylleucylglutaminylserylmethionylthreonylvalylarginylglutaminylglycylserylglutaminylvalylarginylleucylglutaminylvalylarginylvalylthreonylglycylisoleucylprolylasparaginylprolylvalylvalyllysylphenylalanyltyrosylarginylaspartylglycylalanylglutamylisoleucylglutaminylserylserylleucylaspartylphenylalanylglutaminylisoleucylserylglutaminylglutamylglycylaspartylleucyltyrosylserylleucylleucylisoleucylalanylglutamylalanyltyrosylprolylglutamylaspartylserylglycylthreonyltyrosylserylvalylasparaginylalanylthreonylasparaginylserylvalylglycylarginylalanylthreonylserylthreonylalanylglutamylleucylleucylvalylglutaminylglycylglutamylglutamylglutamylvalylprolylalanyllysyllysylthreonyllysylthreonylisoleucylvalylserylthreonylalanylglutaminylisoleucylserylglutamylserylarginylglutaminylthreonylarginylisoleucylglutamyllysyllysylisoleucylglutamylalanylhistidylphenylalanylaspartylalanylarginylserylisoleucylalanylthreonylvalylglutamylmethionylvalylisoleucylaspartylglycylalanylalanylglycylglutaminylglutaminylleucylprolylhistidyllysylthreonylprolylprolylarginylisoleucylprolylprolyllysylprolyllysylserylarginylserylprolylthreonylprolylprolylserylisoleucylalanylalanyllysylalanylglutaminylleucylalanylarginylglutaminylglutaminylserylprolylserylprolylisoleucylarginylhistidylserylprolylserylprolylvalylarginylhistidylvalylarginylalanylprolylthreonylprolylserylprolylvalylarginylserylvalylserylprolylalanylalanylarginylisoleucylserylthreonylserylprolylisoleucylarginylserylvalylarginylserylprolylleucylleucylmethionylarginyllysylthreonylglutaminylalanylserylthreonylvalylalanylthreonylglycylprolylglutamylvalylprolylprolylprolyltryptophyllysylglutaminylglutamylglycyltyrosylvalylalanylserylserylserylglutamylalanylglutamylmethionylarginylglutamylthreonylthreonylleucylthreonylthreonylserylthreonylglutaminylisoleucylarginylthreonylglutamylglutamylarginyltryptophylglutamylglycylarginyltyrosylglycylvalylglutaminylglutamylglutaminylvalylthreonylisoleucylserylglycylalanylalanylglycylalanylalanylalanylserylvalylserylalanylserylalanylseryltyrosylalanylalanylglutamylalanylvalylalanylthreonylglycylalanyllysylglutamylvalyllysylglutaminylaspartylalanylaspartyllysylserylalanylalanylvalylalanylthreonylvalylvalylalanylalanylvalylaspartylmethionylalanylarginylvalylarginylglutamylprolylvalylisoleucylserylalanylvalylglutamylglutaminylthreonylalanylglutaminylarginylthreonylthreonylthreonylthreonylalanylvalylhistidylisoleucylglutaminylprolylalanylglutaminylglutamylglutaminylvalylarginyllysylglutamylalanylglutamyllysylthreonylalanylvalylthreonyllysylvalylvalylvalylalanylalanylaspartyllysylalanyllysylglutamylglutaminylglutamylleucyllysylserylarginylthreonyllysylglutamylisoleucylisoleucylthreonylthreonyllysylglutaminylglutamylglutaminylmethionylhistidylvalylthreonylhistidylglutamylglutaminylisoleucylarginyllysylglutamylthreonylglutamyllysylthreonylphenylalanylvalylprolyllysylvalylvalylisoleucylserylalanylalanyllysylalanyllysylglutamylglutaminylglutamylthreonylarginylisoleucylserylglutamylglutamylisoleucylthreonyllysyllysylglutaminyllysylglutaminylvalylthreonylglutaminylglutamylalanylisoleucylmethionyllysylglutamylthreonylarginyllysylthreonylvalylvalylprolyllysylvalylisoleucylvalylalanylthreonylprolyllysylvalyllysylglutamylglutaminylaspartylleucylvalylserylarginylglycylarginylglutamylglycylisoleucylthreonylthreonyllysylarginylglutamylglutaminylvalylglutaminylisoleucylthreonylglutaminylglutamyllysylmethionylarginyllysylglutamylalanylglutamyllysylthreonylalanylleucylserylthreonylisoleucylalanylvalylalanylthreonylalanyllysylalanyllysylglutamylglutaminylglutamylthreonylisoleucylleucylarginylthreonylarginylglutamylthreonylmethionylalanylthreonylarginylglutaminylglutamylglutaminylisoleucylglutaminylvalylthreonylhistidylglycyllysylvalylaspartylvalylglycyllysyllysylalanylglutamylalanylvalylalanylthreonylvalylvalylalanylalanylvalylaspartylglutaminylalanylarginylvalylarginylglutamylprolylarginylglutamylprolylglycylhistidylleucylglutamylglutamylseryltyrosylalanylglutaminylglutaminylthreonylthreonylleucylglutamyltyrosylglycyltyrosyllysylglutamylarginylisoleucylserylalanylalanyllysylvalylalanylglutamylprolylprolylglutaminylarginylprolylalanylserylglutamylprolylhistidylvalylvalylprolyllysylalanylvalyllysylprolylarginylvalylisoleucylglutaminylalanylprolylserylglutamylthreonylhistidylisoleucyllysylthreonylthreonylaspartylglutaminyllysylglycylmethionylhistidylisoleucylserylserylglutaminylisoleucyllysyllysylthreonylthreonylaspartylleucylthreonylthreonylglutamylarginylleucylvalylhistidylvalylaspartyllysylarginylprolylarginylthreonylalanylserylprolylhistidylphenylalanylthreonylvalylseryllysylisoleucylserylvalylprolyllysylthreonylglutamylhistidylglycyltyrosylglutamylalanylserylisoleucylalanylglycylserylalanylisoleucylalanylthreonylleucylglutaminyllysylglutamylleucylserylalanylthreonylserylserylalanylglutaminyllysylisoleucylthreonyllysylserylvalyllysylalanylprolylthreonylvalyllysylprolylserylglutamylthreonylarginylvalylarginylalanylglutamyl
Except it would go on for 100,000 characters.
Human Impact
Although pRINT, even with the w command, AND concept commands, is very useful, the impacts of it are still heavily debated by many (nobody). However, pRINT has incredible impacts on our human society. For example, it is a great gateway into beginner programming, and allows programs to be created with ease. It also revolutionizes programming, by showing the concept of how such a high level, and useful function can be executed in such little bytes, and with such little effort an requirement. This proof, ultimately prooves the practical use of a language like pRINT, and how it can benefit beginner, and senior developers alike.