@DestructibleWatermelon well you obviously need a camera man. It shouldn't be hard to get a major TV network to film you, this being such an epic extreme sport
@quartata the company went bankrupt, and my dad's friend bought their code, and my dad wants me to start exploring it, but I'm wasn't even sure what the company did
Pyth, 17 bytes
Another one of those Pyth programmers. Sorry.
#Jw
jKC9J
jK+CMJT
Try it online! or use an easier-to-read test case.
Explanation:
# Until we run into an error:
Jw Read in the next line of input and call it J.
(When there i...
Looking at the .py file, you don't have a __name__ == "__main__" check to do your file reading code
which means that it'd be difficult to interface with the Logicode reader with other Python files (any import logicode would cause there to be a file name request to the command line, etc)
now see my horrible spaghetti code, particularly the bottom (I also totally did not add the __name__ == "__main__" check right now, it's obviously of course been there forever and a half) github.com/Steven-Hewitt/LI/blob/master/Interpreter.py
Forever may or may not be a period of time roughly equivalent to 20 seconds
I've kinda given up on development of the Python version of the language, seeing as recursion limits are stupid and mean that standard programs in LI will routinely pass the limit with inputs as small as 10
And, also, recursion is deeply broken and I can't find out why
I'm working on a LISP version that hopes to fix most of those things
At the bottom, and then put all of the code that relies on input directly (pretty much everything that isn't a function definition, a constant, or a class definition) inside the if statement @DerpfacePython
@ASCII-only It's a functional programming language, tail recursion is the best way
Grammar for a programming language is extremely similar to what grammar is in English. It describes what is valid or invalid within the language. (cont.)
In computer science, an LL parser is a top-down parser for a subset of context-free languages. It parses the input from Left to right, performing Leftmost derivation of the sentence.
An LL parser is called an LL(k) parser if it uses k tokens of lookahead when parsing a sentence. If such a parser exists for a certain grammar and it can parse sentences of this grammar without backtracking then it is called an LL(k) grammar. LL(k) grammars can generate more languages the higher the number k of lookahead tokens. A corollary of this is that not all context-free languages can be recognized by an LL(k...
Looks like you need a minimum of 1 token lookahead though
what I currently have for my programming language interpreter:
program=input().split("!")
cp=[0,0]
ip=[0,0]
if any([any(' 'in i[0:1]+i[~0:~1] for i in program),any(any(not i in "| " for i in j)for j in program),not any(' ' in i for i in program)]):
print("confuse :(")
exit()
while True:
ip=cp
while program[ip[0]][ip[1]]!=' ':
ip[1]+=1
if len(program[ip[0]])<=ip[1]:
ip[0]+=1
ip[1]=0
print("spaaaace",ip)
break
just finds the first space, after checking the program is valid
I'm not sure whether what I built can be considered LL(0) or LL(1)
I was trying for LL(0)
Effectively each token is agnostic of what comes before or what comes after it, and is just called with some inputs and returns some other set of outputs
Neither of us were, ASCII recommended it but I hadn't been using it (honestly, it was more messing around than anything else what I was doing with LI's Python interpreter)
Anything that operates on multiple mathematical sets to provide one or more output sets, where you are free to define the set of possible set elements and restrictions upon valid sets
Retina operates on strings, which can be represented as sets of (location, character) elements where the locations are contiguous natural numbers from 0 to n where n is the number of elements in the set
@DerpfacePython As the programming language interpreter stands, it is not TC. When you implement slicing, it will be, even if you just implement head and tail (a[:1] and a[1:])
i know this is not the formally correct answer, but once you take the 'minimal' out of 'Turing-complete' and put 'practical' back where it belongs, you'll see the most important features that distinguish a programming language from a markup language are
variables
conditionals (if/then...)
loop...
did this guy even read the question?
> but if i had to teach n00bies young or old 'what is programming' and 'how to learn to program', i'd hardly start out with the full breadth and width of the theoretical foundations of Turing completeness
other guy: if i had to teach n00bies young or old 'what is programming' and 'how to learn to program', i'd hardly start out with the full breadth and width of the theoretical foundations of Turing completeness...
I don't know why I can't get over this
and the stupidity goes on in the comments, as flow still REFUSES to read the question
>
yesyesyes i know. but all the examples given are more or less esoteric (while maybe interesting or surprising), my answer was a pragmatic one, and very probably not minimal at all. i think it's important to point that out—this page was #1 when searching for Turing-completeness on google, the answers here are IMHO of little use for, say, a n00bie who wants to know what distinguishes HTML from PHP or Python. i mean, brainfck is not called brainfck for no reason
The Rule 110 cellular automaton (often simply Rule 110) is an elementary cellular automaton with interesting behavior on the boundary between stability and chaos. In this respect it is similar to Conway's Game of Life. Also like Life, Rule 110 is known to be Turing complete. This implies that, in principle, any calculation or computer program can be simulated using this automaton.
== DefinitionEdit ==
In an elementary cellular automaton, a one-dimensional pattern of 0s and 1s evolves according to a simple set of rules. Whether a point in the pattern will be 0 or 1 in the new generation depends...