'''Tip''' is an [[esoteric programming language]] created by [[User:ais523]] in [[:Category:2018|2018]], as a minimization of iterated [[Collatz function]]s (which were already pretty minimal to start with!). It allows for ''very'' terse implementations in many languages which have primitives for handling rational numbers. The name is an acronym for "times instruction pointer".
As the language is intended as a target language for interpreter [[golf]], it has no fixed syntax (interpreters are expected to use whatever encoding of the program is most convenient, which probably will not even be a sequence of bytes, and as such Tip programs cannot be stored in a file without an additional encoding step). However, it is likely to be trivial to convert between the syntaxes required by various interpreters. (As such, the language falls into a similar category as languages like Algol, which also just defined a list of syntactic elements the language needed and left it up to the various implementations as to how to spell them.)
== Specification ==
A Tip program consists of a list of commands, plus an initial value for the instruction pointer (which must be a positive integer). There are two commands that can appear within the command list; goto commands and the halt command (which ends the program). A goto command takes a positive rational number as its argument, and is written simply by writing the argument in question in whatever syntax the implementation requires. (As a special case, using 0 or 1 as a goto command argument is syntactically invalid; this enables implementations to allow either of these values to be used as a special case for representing the halt command without making the implementation nonportable to Tip programs intended for other interpreters. Interpreters need not be able to diagnose this particular syntax error, or indeed any form of syntax error.) A halt command will also typically be represented as a number, but the choice of number will depend on what is most convenient for the implementation; however, it must be something that's invalid as a goto command argument (i.e. 0, 1, a negative number, an infinite number, an irrational number, or an imaginary/complex number), thus ensuring that it can always be distinguished from a goto command.
Unusually, the program is seen not as a finite entity, but as covering the entirety of an infinite memory space; the program is conceptually repeated an infinite number of times to create an infinitely long program (in practice, implementations will instead use only one copy of the program and perform a modulo operation on the instruction pointer, thus saving the need to make an infinite number of copies before starting).
The instruction pointer starts with the initial value specified by the program. (Depending on the implementation, the language might be 0-indexed or 1-indexed, i.e. command 1 might be the second or first command of the program; it's trivial to convert programs between these two language dialects by moving the first command to the end or vice versa.) When executed, a goto command multiplies the instruction pointer by its argument, i.e. it can be seen as goto *(ip * a);
or as ip *= a;
; there's no implicit increment of the IP (i.e. whichever line the goto command goes to, that's the line which will execute next). The halt command halts the program when executed. The language has no RAM or other similar mutable addressable memory; the only data used are the program (which never changes) and the instruction pointer (which is just a number).
Allowing the instruction pointer to become anything other than an integer is [[undefined behaviour]]. (In order to prevent such undefined behaviour occurring, a Tip programmer can ensure that the denominator of each goto instruction divides into both its location within the program and the number of commands in the program, thus ensuring that whichever copy of the instruction is run, the IP will be divisible by the instruction's denominator and thus the result of the multiplication will be an integer.)
== Relationships to other languages / language families ==
Tip is almost an [[OISC]]. It can be seen as an OISC either via treating the "halt argument" as a special case, by using 0 as a halt argument and "memory-mapping" halt behaviour, or by using an imaginary number as the halt argument to effectively move the IP "outside the bounds of the program"; even though the program is being treated as infinite, it's only infinite along a single line in the complex plane.
Tip is also a special case of a [[Collatz function]] (specifically, the special case where all ''s''i
are 0); halting behaviour for Collatz functions is normally defined as entering a trivial infinite loop, in which case either 0 or 1 works as a halt instruction.
== Computational class ==
Tip is [[Turing complete]], which can be seen via implementing a [[Minsky machine]] with two counters. We use a construction in which the Minsky machine commands can be an increment of either counter, an unconditional decrement of either counter ([[undefined behaviour]] upon an attempt to decrement zero), or a zero-test (which goes to one of two states depending on whether a particular counter is zero).
Let ''p'' be a prime number that's a) at least 7, b) at least 2 more than the number of states of the Minsky machine. (Each state of the Minsky machine, including the halt state, is given an arbitrary number from 2 to ''p''-1 inclusive.) Let ''x'' equal 2''p''-1, and ''y'' equal 5''p''-1; and define ''F''(''s'', ''t'') as the set of positive integers which are equal to 1 mod 10 and to ''t''÷''s'' mod ''p'' (where the division symbol refers to finite field division mod ''p''); by the Chinese Remainder Theorem, such a set exists and has infinitely many elements, because ''p'' and 10 are coprime. Let ''f''(''s'', ''t'') be the smallest element of ''F''(''s'',''t'').
At any given point in the program's execution (after the first Tip command has run), our invariant is that the Tip instruction pointer will equal ''x'' to the power of the first counter, times ''y'' to the power of the second counter, times an element of ''F''(1, ''t'') (where ''t'' is the number of the Minsky machine's current state).
The compiled Tip program consists of 10''p'' instructions, with initial instruction pointer value 1, and the instruction in position ''n'' of the Tip program is determined as follows:
* If ''n'' mod ''p'' is 0, the instruction is irrelevant (this construction never allows the instruction pointer to divide ''p'').
* If ''n'' mod ''p'' is 1, the instruction is a goto instruction, and its argument is ''x'' to the power of the first counter, times ''y'' to the power of the second counter, times ''f''(1, ''t'') (where ''t'' is the Minsky machine's initial state). This obviously means that at the start of the program (where the IP has value 1), the simulated Minsky machine will be initialised appropriately.
* If ''n'' mod ''p'' is the number of the Minsky machine's halt state, the instruction is a halt instruction.
* If ''n'' mod ''p'' is the number of a state that increments the first counter, the instruction is a goto instruction, and its argument is ''xf''(''s'',''t'') (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it).
* If ''n'' mod ''p'' is the number of a state that increments the second counter, the instruction is a goto instruction, and its argument is ''yf''(''s'',''t'') (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it).
* If ''n'' mod ''p'' is the number of a state that decrements the first counter, the instruction is a goto instruction, and its argument is ''f''(''s'',''t'')/''x'' (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it).
* If ''n'' mod ''p'' is the number of a state that decrements the second counter, the instruction is a goto instruction, and its argument is ''f''(''s'',''t'')/''y'' (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it).
* If ''n'' mod ''p'' is the number of a state that zero-tests the first counter, and ''n'' mod 2 is nonzero, the instruction is a goto instruction, and its argument is ''f''(''s'',''t'') (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it when the first counter is zero).
* If ''n'' mod ''p'' is the number of a state that zero-tests the first counter, and ''n'' mod 2 is 0, the instruction is a goto instruction, and its argument is ''f''(''s'',''t'') (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it when the first counter is positive).
* If ''n'' mod ''p'' is the number of a state that zero-tests the second counter, and ''n'' mod 5 is nonzero, the instruction is a goto instruction, and its argument is ''f''(''s'',''t'') (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it when the second counter is zero).
* If ''n'' mod ''p'' is the number of a state that zero-tests the second counter, and ''n'' mod 5 is 0, the instruction is a goto instruction, and its argument is ''f''(''s'',''t'') (where ''s'' is the number of the state being compiled, and ''t'' is the number of the state that follows it when the first second is positive).
It can be seen that, given our invariant for how the Tip IP and Minsky machine memory state relate, each Tip instruction will have exactly the same effect as the corresponding Minsky machine instruction. (By Fermat's Little Theorem, ''x'' and ''y'' both equal 1 mod ''p'', and all ''f'' values are 1 mod 10, so multiplying or dividing by ''x'' or ''y'' won't change the value of the instruction pointer mod ''p'', and multiplying by an ''f'' value won't change number of multiples of 2 or 5 that exist within the instruction pointer, and so we can treat the "two parts" of the IP's state independently.)
Note that more efficient constructions are available: for example, it's possible to inline a whole sequence of increments and decrements into a single Tip instruction. However, the simple construction above is enough to demonstrate the computational class of the language.
== Variations ==
Although Tip is defined in terms of rational numbers, it's still Turing-complete if restricted to (bignum) decimal fixed-point numbers with sufficiently many decimal places; in the construction above, all the goto commands used are terminating decimals. It is not Turing-complete when using (binary) floating-point for the instruction pointer rather than an integer; even allowing for a bignum exponent, it becomes a one-counter machine, as only finitely many mantissas exist, and for any given mantissa, there's no way to distinguish more than finitely many values for the exponent via which command is running. (This in turn means that in most languages, it's difficult to accept the program as floating point, as the instruction will typically be "promoted" to floating point as a consequence.)
It's fairly simple to add batch I/O to the language. One simple construction that fits into the spirit of the rest of the language is to start at minus the IP's stated initial value, and to negate it (i.e. multiplying by -1) after a number of commands have run equal to the input (which must be a positive integer); and when the program halts, to output the number of times copies of the same command were run in a row immediately before halting (this will also be a positive integer); when input is not in use, this is equivalent to an (otherwise invalid) input of 0 (i.e. the IP gets negated twice before the program even runs).
The requirement to allow programs to specify the initial instruction pointer is not necessary (and is added only because taking it from input is often terser than requiring it to be hardcoded); always starting the instruction pointer at 1 is still sufficient for Turing-completeness, as shown by the construction above.
== Example ==
Here's a simple program to double a number (it doubles 4 when I/O is not used, or the input when I/O is used):
* Initial IP: 1
* Commands: [1/4, 196608, 16, ''halt'', 3, 16]
and here are debug traces, produced using the Perl implementation below:
Initial IP: 1 Program: [1/4 196608 16 0 3 16] IP 1: running command: 196608 (index 1 of program) IP 196608: running command: 1/4 (index 0 of program) IP 49152: running command: 1/4 (index 0 of program) IP 12288: running command: 1/4 (index 0 of program) IP 3072: running command: 1/4 (index 0 of program) IP 768: running command: 1/4 (index 0 of program) IP 192: running command: 1/4 (index 0 of program) IP 48: running command: 1/4 (index 0 of program) IP 12: running command: 1/4 (index 0 of program) IP 3: running command: 0 (index 3 of program)
Initial IP: 1 Program: [1/4 196608 16 0 3 16] IP -1: running command: 16 (index 5 of program) IP -16: running command: 16 (index 2 of program) IP -256: running command: 16 (index 2 of program) IP -4096: running command: 16 (index 2 of program) IP -65536: running command: 16 (index 2 of program) IP 1048576: running command: 3 (index 4 of program) IP 3145728: running command: 1/4 (index 0 of program) IP 786432: running command: 1/4 (index 0 of program) IP 196608: running command: 1/4 (index 0 of program) IP 49152: running command: 1/4 (index 0 of program) IP 12288: running command: 1/4 (index 0 of program) IP 3072: running command: 1/4 (index 0 of program) IP 768: running command: 1/4 (index 0 of program) IP 192: running command: 1/4 (index 0 of program) IP 48: running command: 1/4 (index 0 of program) IP 12: running command: 1/4 (index 0 of program) IP 3: running command: 0 (index 3 of program) 10
== See also == * [[OISC]] * [[Collatz function]] * [[Golf]] == External resources == * [https://codegolf.stackexchange.com/a/168471 The history/background behind this language.] Includes a 4-byte interpreter in [[M]]. [[Category:Languages]][[Category:2018]][[Category:Turing complete]][[Category:Turing tarpits]][[Category:Implemented]][[Category:Low-level]] {{WIP}} '''TAPASM''' is an esoteric language by [[User:Christian Irwan]] using sticky tape. It resembles [[assembly code]]. (Note, it's incomplete, so I want your preferences) == Register == TAPASM has 8 register, named tpa, tpb, tpc, tpd, tpe, tpf, tpg, tph. In the instruction section, tp1 and tp2 can be replaced with that. Register is place in the tape of program. It is initialized in leftmost area. Register opcodes are: STICK tp1, tp2 ; Stick tape in tape location 1 with tape location 2. Throw exception if it has been stick, tp1 and tp2 is overlap or have different length. Temporary the value tp1 and tp2 will added together STICK tp1 ; Stick tp1 with nontape, thus does nothing until released that divided it by two () . RELES tp1 ; Release tape in tape location 1. Any tape that stick in this tape location will be unstick. Area that is unstick will have it's value averaged by other place that is also unstick (With 10% tolerance, but longer it's sticked, the tolerance is lower until it 0% alias it will correctly averaged). SCRTH tp1 ; Make tp1 off LNGTH tp1, imm ; set tp1's length absolute to imm. Right bound will be adjusted. LNGTH tp1, tp2 ; set tp1's length absolute to tp2. Right bound will be adjusted. LNGTR tp1, imm ; set tp1's length relative to imm. Imm is signed. Right bound will beadjusted. LNGTR tp1, tp2 ; set tp1's length relative to tp2. Tp2 is signed. Right bound will be adjusted. SHRLF tp1, imm ; shift tp1 left by imm. Throws error if the result is off the tape SHRLF tp1, tp2 ; shift tp1 left by tp2. Throws error if the result is off the tape SHRRG tp1, imm ; shift tp1 right by imm. Throws error if the result is off the tape SHRRG tp1, tp2 ; shift tp1 right by tp2. Throws error if the result is off the tape SETTP tp1, imm ; Set the tape location 1 to using imm-th tape cut. == Flags == Like ordinary assembly, there are flags in there. Flags is used to control movement by serve as conditional for many operator. The defined flags are: 0 FF Full flag 1 ZF Zero Flag FF = 1 and ZF = 1 is possible and used for indicating error. Undefined flag can be used for many usages as you want, example error handling. Flag opcodes are: TEST tp1 ; Set FF if all of tp1 is set and ZF is all of tp1 is not set. SF imm ; Set the imm-th flag CF imm ; clear the imm-th flag SIE imm, tp1 ; Set the imm-th flag if tp1 is all clear SIF imm, tp1 ; Set the imm-th flag if tp1 is all set CIE imm, tp1 ; Clear the imm-th flag if tp1 is all clear CIF imm, tp1 ; Clear the imm-th flag if tp1 is all set And the jump instruction is: (Jump instruction always in form Jnn xxxxxxxx where Jnn is opcode and xxxxxxxx is a label, except) JF ; Jump if FF is set and ZF is not set JP ; Jump if both FF and ZF not set JE ; Jump if ZF is set and FF is not set JER ; Jump if both ZF and FF is set JFL xx, xxxxxxxx ; Jump if xx-th flag is set JNFL xx, xxxxxxxx ; Jump if xx-th flag is not set JMP xxxxxxxx ; Jump unconditionally. == Tape == TAPASM has 1 infinite tape to right. The tape can be cut, stick to other tape location, and released. Released tape have it averaged with it's counterpart until it turns zero. Defined by tape segment. Reached tape if not stick will reduce it's value. Example, a cell's value is 1, can go down to 0.9 until zero The only code that is only for tape that hasn't any role for register is: CUT tp1 ; Cut the tape to three pieces divided by tp1. Any segment that have data will be pushed to global tapes. ===Tape Segment === TAPASM's tape data declarated by following:use warnings; use strict; use Math::BigRat; my $ip = Math::BigRat->new(scalar <>); my @program; while (defined ($_ = <>)) { if (/H/) { push @program, 0; } else { push @program, Math::BigRat->new($_); } } print STDERR "Initial IP: $ip\n"; print STDERR "Program: [@program]\n"; my $input = <>; my $inputdefined = defined $input; my $lastci = .5; my $output = 0; while ($ip) { my $eip = $input ? -$ip : $ip; $eip < 0 and $input--; my $ci = $eip % @program; $ci < 0 and $ci += @program; my $cmd = $program[$ci]->copy(); print STDERR "IP $eip: running command: $cmd (index $ci of program)\n"; $ip->bmul($cmd); if ($ci == $lastci) { $output++; } elsif ($ip) { $output = 1; $lastci = $ci; } } $inputdefined and print "$output\n";
#Section Tape ;Begin a section tape #Roll ;Declare a infinite tape df 0.6 ;Declare a byte. Look below #Part ;Begin a part. Ended by next segment of tape db 25 ;Declare a byte dw 501 ;Declare a word df 0.55 ;Declare a byte, but in this, byte is ranged from 0 to 1 with 0.5 above equals true #Section CodeThen data is stored from top to bottom. So, the tape result is (With .. means infinite): |[0.6][1][1][1]..|[0][0][0][1][1][0][0][1] [0][0][0][0][0][0][0][1][1][1][1][1][0][1][0][1][0.55]| == Interrupt == TAPASM has interrupt that behave differently about one interpreter and another. But if the interrupt is not supported, quit with exit code same as interrupt number. Example of interrupt int 0 ;exit happily (Must be implemented as is) int 1 ;set the tpa with STDIN. tpa's length is set first to 8. int 2 ;output the tpa to STDOUT. tpa's length is set first to 8. INT imm ; do a interrup that is supported by assembler/interpreter. If it's not supported, exit with error number imm. == Execution == TAPASM is like assembly. There are call stack, so you can do CALLs and RETurns. CALL xxxxxxxx ; Call The xxxxxxxx part of code RET ; Return to the caller Well, there are no stack in TAPASM, so you must allocate one roll(or infinite part) to imitate that. == Example == Hello World program: #Section Tape db 48 db 65 db 6C db 6C db 6F db 20 db 57 db 6F db 72 db 6C db 64 #Section Code Main: LENGTH tpa, 8 INT 2 #Repeat 10 ;A preprocessor to repeat 10 times SHRLF tpa, 8 INT 2 #End Repeat [[Category:Languages]] [[Category:Cell-based]] [[Category:2013]] [[Category:Low-level]] {{Distinguish/Confusion|Txet}} '''Text''' is a programming language created by [[User:Smallhacker]]. Whilst not many people have heard of Text, almost all ASCII files, including readmes, and interpreted programming language source code files, are actually written in Text. == Description == All Text programs output their own source code, thus every program is a [[quine]]. Despite the language being very young, there's already A BIG AMOUNT OF of interpreters for Text, perhaps the most famous of which is Notepad. On Unix-derived systems, the traditional interpreter is 'cat'. On Windows, the traditional interpreter is the 'type' command. The file extension for Text programs is '''.txt'''. (It's just a plain text file.) However, many Text programs omit the file extension. Some relatively recent Text interpreters, such as TextEdit on the Macintosh, add support for 2D graphics. Given that books and paper are fully capable of executing Text programs, they're actually probably some the first computers ever invented. == Examples == === Hello World === Hello, World! === FizzBuzz ===
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 Fizz-Buzz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 Fizz-Buzz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 Fizz-Buzz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 Fizz-Buzz 61 62 Fizz 64 Buzz Fizz 67 68 Fizz Buzz 71 Fizz 73 74 Fizz-Buzz 76 77 Fizz 79 Buzz Fizz 82 83 Fizz Buzz 86 Fizz 88 89 Fizz-Buzz 91 92 Fizz 94 Buzz Fizz 97 98 Fizz Buzz 101 Fizz 103 104 And so on, Triples replaced with Fizz, Quintuples replaced with Buzz, and Quintuodecuples replaced with Fizz-Buzz.=== Quine === In this Esolang, all program will be a quine. In other words, it don't care what did you wrote, it just copy your input to STDOUT. === 99 Bottles of Beer === 99 bottles of beer on the wall, 99 bottles of beer. Take one down and pass it around, 98 bottles of beer on the wall. 98 bottles of beer on the wall, 98 bottles of beer. Take one down and pass it around, 97 bottles of beer on the wall. 97 bottles of beer on the wall, 97 bottles of beer. Take one down and pass it around, 96 bottles of beer on the wall. 96 bottles of beer on the wall, 96 bottles of beer. Take one down and pass it around, 95 bottles of beer on the wall. 95 bottles of beer on the wall, 95 bottles of beer. Take one down and pass it around, 94 bottles of beer on the wall. 94 bottles of beer on the wall, 94 bottles of beer. Take one down and pass it around, 93 bottles of beer on the wall. 93 bottles of beer on the wall, 93 bottles of beer. Take one down and pass it around, 92 bottles of beer on the wall. 92 bottles of beer on the wall, 92 bottles of beer. Take one down and pass it around, 91 bottles of beer on the wall. 91 bottles of beer on the wall, 91 bottles of beer. Take one down and pass it around, 90 bottles of beer on the wall. 90 bottles of beer on the wall, 90 bottles of beer. Take one down and pass it around, 89 bottles of beer on the wall. 89 bottles of beer on the wall, 89 bottles of beer. Take one down and pass it around, 88 bottles of beer on the wall. 88 bottles of beer on the wall, 88 bottles of beer. Take one down and pass it around, 87 bottles of beer on the wall. 87 bottles of beer on the wall, 87 bottles of beer. Take one down and pass it around, 86 bottles of beer on the wall. 86 bottles of beer on the wall, 86 bottles of beer. Take one down and pass it around, 85 bottles of beer on the wall. 85 bottles of beer on the wall, 85 bottles of beer. Take one down and pass it around, 84 bottles of beer on the wall. 84 bottles of beer on the wall, 84 bottles of beer. Take one down and pass it around, 83 bottles of beer on the wall. 83 bottles of beer on the wall, 83 bottles of beer. Take one down and pass it around, 82 bottles of beer on the wall. 82 bottles of beer on the wall, 82 bottles of beer. Take one down and pass it around, 81 bottles of beer on the wall. 81 bottles of beer on the wall, 81 bottles of beer. Take one down and pass it around, 80 bottles of beer on the wall. 80 bottles of beer on the wall, 80 bottles of beer. Take one down and pass it around, 79 bottles of beer on the wall. 79 bottles of beer on the wall, 79 bottles of beer. Take one down and pass it around, 78 bottles of beer on the wall. 78 bottles of beer on the wall, 78 bottles of beer. Take one down and pass it around, 77 bottles of beer on the wall. 77 bottles of beer on the wall, 77 bottles of beer. Take one down and pass it around, 76 bottles of beer on the wall. 76 bottles of beer on the wall, 76 bottles of beer. Take one down and pass it around, 75 bottles of beer on the wall. 75 bottles of beer on the wall, 75 bottles of beer. Take one down and pass it around, 74 bottles of beer on the wall. 74 bottles of beer on the wall, 74 bottles of beer. Take one down and pass it around, 73 bottles of beer on the wall. 73 bottles of beer on the wall, 73 bottles of beer. Take one down and pass it around, 72 bottles of beer on the wall. 72 bottles of beer on the wall, 72 bottles of beer. Take one down and pass it around, 71 bottles of beer on the wall. 71 bottles of beer on the wall, 71 bottles of beer. Take one down and pass it around, 70 bottles of beer on the wall. 70 bottles of beer on the wall, 70 bottles of beer. Take one down and pass it around, 69 bottles of beer on the wall. 69 bottles of beer on the wall, 69 bottles of beer. Take one down and pass it around, 68 bottles of beer on the wall. 68 bottles of beer on the wall, 68 bottles of beer. Take one down and pass it around, 67 bottles of beer on the wall. 67 bottles of beer on the wall, 67 bottles of beer. Take one down and pass it around, 66 bottles of beer on the wall. 66 bottles of beer on the wall, 66 bottles of beer. Take one down and pass it around, 65 bottles of beer on the wall. 65 bottles of beer on the wall, 65 bottles of beer. Take one down and pass it around, 64 bottles of beer on the wall. 64 bottles of beer on the wall, 64 bottles of beer. Take one down and pass it around, 63 bottles of beer on the wall. 63 bottles of beer on the wall, 63 bottles of beer. Take one down and pass it around, 62 bottles of beer on the wall. 62 bottles of beer on the wall, 62 bottles of beer. Take one down and pass it around, 61 bottles of beer on the wall. 61 bottles of beer on the wall, 61 bottles of beer. Take one down and pass it around, 60 bottles of beer on the wall. 60 bottles of beer on the wall, 60 bottles of beer. Take one down and pass it around, 59 bottles of beer on the wall. 59 bottles of beer on the wall, 59 bottles of beer. Take one down and pass it around, 58 bottles of beer on the wall. 58 bottles of beer on the wall, 58 bottles of beer. Take one down and pass it around, 57 bottles of beer on the wall. 57 bottles of beer on the wall, 57 bottles of beer. Take one down and pass it around, 56 bottles of beer on the wall. 56 bottles of beer on the wall, 56 bottles of beer. Take one down and pass it around, 55 bottles of beer on the wall. 55 bottles of beer on the wall, 55 bottles of beer. Take one down and pass it around, 54 bottles of beer on the wall. 54 bottles of beer on the wall, 54 bottles of beer. Take one down and pass it around, 53 bottles of beer on the wall. 53 bottles of beer on the wall, 53 bottles of beer. Take one down and pass it around, 52 bottles of beer on the wall. 52 bottles of beer on the wall, 52 bottles of beer. Take one down and pass it around, 51 bottles of beer on the wall. 51 bottles of beer on the wall, 51 bottles of beer. Take one down and pass it around, 50 bottles of beer on the wall. 50 bottles of beer on the wall, 50 bottles of beer. Take one down and pass it around, 49 bottles of beer on the wall. 49 bottles of beer on the wall, 49 bottles of beer. Take one down and pass it around, 48 bottles of beer on the wall. 48 bottles of beer on the wall, 48 bottles of beer. Take one down and pass it around, 47 bottles of beer on the wall. 47 bottles of beer on the wall, 47 bottles of beer. Take one down and pass it around, 46 bottles of beer on the wall. 46 bottles of beer on the wall, 46 bottles of beer. Take one down and pass it around, 45 bottles of beer on the wall. 45 bottles of beer on the wall, 45 bottles of beer. Take one down and pass it around, 44 bottles of beer on the wall. 44 bottles of beer on the wall, 44 bottles of beer. Take one down and pass it around, 43 bottles of beer on the wall. 43 bottles of beer on the wall, 43 bottles of beer. Take one down and pass it around, 42 bottles of beer on the wall. 42 bottles of beer on the wall, 42 bottles of beer. Take one down and pass it around, 41 bottles of beer on the wall. 41 bottles of beer on the wall, 41 bottles of beer. Take one down and pass it around, 40 bottles of beer on the wall. 40 bottles of beer on the wall, 40 bottles of beer. Take one down and pass it around, 39 bottles of beer on the wall. 39 bottles of beer on the wall, 39 bottles of beer. Take one down and pass it around, 38 bottles of beer on the wall. 38 bottles of beer on the wall, 38 bottles of beer. Take one down and pass it around, 37 bottles of beer on the wall. 37 bottles of beer on the wall, 37 bottles of beer. Take one down and pass it around, 36 bottles of beer on the wall. 36 bottles of beer on the wall, 36 bottles of beer. Take one down and pass it around, 35 bottles of beer on the wall. 35 bottles of beer on the wall, 35 bottles of beer. Take one down and pass it around, 34 bottles of beer on the wall. 34 bottles of beer on the wall, 34 bottles of beer. Take one down and pass it around, 33 bottles of beer on the wall. 33 bottles of beer on the wall, 33 bottles of beer. Take one down and pass it around, 32 bottles of beer on the wall. 32 bottles of beer on the wall, 32 bottles of beer. Take one down and pass it around, 31 bottles of beer on the wall. 31 bottles of beer on the wall, 31 bottles of beer. Take one down and pass it around, 30 bottles of beer on the wall. 30 bottles of beer on the wall, 30 bottles of beer. Take one down and pass it around, 29 bottles of beer on the wall. 29 bottles of beer on the wall, 29 bottles of beer. Take one down and pass it around, 28 bottles of beer on the wall. 28 bottles of beer on the wall, 28 bottles of beer. Take one down and pass it around, 27 bottles of beer on the wall. 27 bottles of beer on the wall, 27 bottles of beer. Take one down and pass it around, 26 bottles of beer on the wall. 26 bottles of beer on the wall, 26 bottles of beer. Take one down and pass it around, 25 bottles of beer on the wall. 25 bottles of beer on the wall, 25 bottles of beer. Take one down and pass it around, 24 bottles of beer on the wall. 24 bottles of beer on the wall, 24 bottles of beer. Take one down and pass it around, 23 bottles of beer on the wall. 23 bottles of beer on the wall, 23 bottles of beer. Take one down and pass it around, 22 bottles of beer on the wall. 22 bottles of beer on the wall, 22 bottles of beer. Take one down and pass it around, 21 bottles of beer on the wall. 21 bottles of beer on the wall, 21 bottles of beer. Take one down and pass it around, 20 bottles of beer on the wall. 20 bottles of beer on the wall, 20 bottles of beer. Take one down and pass it around, 19 bottles of beer on the wall. 19 bottles of beer on the wall, 19 bottles of beer. Take one down and pass it around, 18 bottles of beer on the wall. 18 bottles of beer on the wall, 18 bottles of beer. Take one down and pass it around, 17 bottles of beer on the wall. 17 bottles of beer on the wall, 17 bottles of beer. Take one down and pass it around, 16 bottles of beer on the wall. 16 bottles of beer on the wall, 16 bottles of beer. Take one down and pass it around, 15 bottles of beer on the wall. 15 bottles of beer on the wall, 15 bottles of beer. Take one down and pass it around, 14 bottles of beer on the wall. 14 bottles of beer on the wall, 14 bottles of beer. Take one down and pass it around, 13 bottles of beer on the wall. 13 bottles of beer on the wall, 13 bottles of beer. Take one down and pass it around, 12 bottles of beer on the wall. 12 bottles of beer on the wall, 12 bottles of beer. Take one down and pass it around, 11 bottles of beer on the wall. 11 bottles of beer on the wall, 11 bottles of beer. Take one down and pass it around, 10 bottles of beer on the wall. 10 bottles of beer on the wall, 10 bottles of beer. Take one down and pass it around, 9 bottles of beer on the wall. 9 bottles of beer on the wall, 9 bottles of beer. Take one down and pass it around, 8 bottles of beer on the wall. 8 bottles of beer on the wall, 8 bottles of beer. Take one down and pass it around, 7 bottles of beer on the wall. 7 bottles of beer on the wall, 7 bottles of beer. Take one down and pass it around, 6 bottles of beer on the wall. 6 bottles of beer on the wall, 6 bottles of beer. Take one down and pass it around, 5 bottles of beer on the wall. 5 bottles of beer on the wall, 5 bottles of beer. Take one down and pass it around, 4 bottles of beer on the wall. 4 bottles of beer on the wall, 4 bottles of beer. Take one down and pass it around, 3 bottles of beer on the wall. 3 bottles of beer on the wall, 3 bottles of beer. Take one down and pass it around, 2 bottles of beer on the wall. 2 bottles of beer on the wall, 2 bottles of beer. Take one down and pass it around, 1 bottle of beer on the wall. 1 bottle of beer on the wall, 1 bottle of beer. Take one down and pass it around, no more bottles of beer on the wall. No more bottles of beer on the wall, no more bottles of beer. Go to the store and buy some more, 99 bottles of beer on the wall. === Song for my homeland ===
五星红旗迎风飘扬, 胜利歌声多么响亮! 歌唱我们亲爱的祖国, 从今走向繁荣富强! 歌唱我们亲爱的祖国, 从今走向繁荣富强! 越过高山,越过平原, 跨过奔腾的黄河长江; 宽广美丽的土地, 是我们亲爱的家乡. 英雄的人民站起来了! 我们团结友爱坚强如钢! 五星红旗迎风飘扬, 胜利歌声多么响亮! 歌唱我们亲爱的祖国, 从今走向繁荣富强! 歌唱我们亲爱的祖国, 从今走向繁荣富强! 我们勤劳,我们勇敢, 独立自由是我们的理想; 我们战胜了多少苦难, 才得到今天的解放! 我们爱和平,我们爱家乡. 谁敢侵犯我们就叫他灭亡! 五星红旗迎风飘扬, 胜利歌声多么响亮! 歌唱我们亲爱的祖国, 从今走向繁荣富强! 歌唱我们亲爱的祖国, 从今走向繁荣富强! 东方太阳,正在升起, 人民共和国正在成长; 我们领袖毛泽东, 指引着前进的方向. 我们的生活天天向上, 我们的前途万丈光芒! 五星红旗迎风飘扬, 胜利歌声多么响亮! 歌唱我们亲爱的祖国, 从今走向繁荣富强! 歌唱我们亲爱的祖国, 从今走向繁荣富——强!=== Never gonna give you up ===
(Intro) IV-V-III-VI-IV-V-III-VI-I-... We're no strangers to love You know the rules and so do I (do I) A full commitment's what I'm thinking of You wouldn't get this from any other guy I just wanna tell you how I'm feeling Gotta make you understand Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you We've known each other for so long Your heart's been aching, but you're too shy to say it (say it) Inside, we both know what's been going on (going on) We know the game and we're gonna play it And if you ask me how I'm feeling Don't tell me you're too blind to see Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you We've known each other for so long Your heart's been aching, but you're too shy to say it (say it) Inside, we both know what's been going on (going on) We know the game and we're gonna play it I just wanna tell you how I'm feeling Gotta make you understand Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you== Compilers == Here are a few compilers for Text: echo - Present as a statement in some script language like Bash and Batch, executes a statement of a Text program copy con - Present as a statement in Batch, executes a Text program written by the user in stdin and writes its output to a text file type - Executes a Text program (from a source code file) Even the recent Ideone.com online multiple language compiler can compile Text Programs. Its example program is: Charlie bit me! And it provides an example stdin: That really hurts! The application returns the value: Charlie bit me! === Development of a compiler === In fact it is really easy to make a Text compiler. Here are some examples. The first (made in Pascal) reads a Text statement and executes it. The second one (made in console VB.NET) reads from the command line a txt file and executes it (like type): ''' Pascal ''' program textcompiler; uses crt; var a:string; begin a:='Here is a sample Text statement' // read the Text statement write(a); // execute the Text program end. ''' VB.NET ''' Class TextCompiler Sub Main() Console.WriteLine(My.Computer.FileSystem.ReadAllText(Command())) 'executes the Text program inside a text file passed in the command line End Sub End Class ''' AWK ''' 1 ''' [[Befunge]] ''' ~:1+!#@_, ''' [[BrainFuck]] ''' ,[.,] ''' C ''' This is a version that reads from text files, not from the console.
#include''' Python ''' print(__import__("sys").stdin.read()) ''' [[🕳️]] ''' {🕳️} ''' [[Cat Program (language)]] ''' ''' [[中文|Standard modern vernacular]] '''int main(int a, char *v[]) { FILE *f=fopen(v[1],"r"); char c; while((c=fgetc(f))!=EOF) putchar(c); }
引入 sys 库中的所有模块。 定义字符串变量 filename ,然后初始化为 "Example.txt" 。 定义字符串变量 content 。 打开文件 filename 。 从 STDIN 中读取 filename ,然后存储至 content 。 IMPAK… Serpihan yang terbang akan berbahaya kepada mereka yang ditangkap tanpa perlindungan. Rumah mudah alih akan rosak atau musnah. Kerosakan pada bumbung, tingkap dan kenderaan akan berlaku. Kerosakan pokok berkemungkinan besar. (Jika PDS: Anda berada dalam situasi yang mengancam nyawa. Serpihan yang berterbangan mungkin membawa maut kepada mereka yang ditangkap tanpa perlindungan. Rumah mudah alih akan musnah. Kerosakan yang besar pada rumah...perniagaan...dan kenderaan berkemungkinan besar dan kemusnahan sepenuhnya mungkin .) (Jika dari kebakaran hutan dalam kes yang jarang berlaku: Tingkah laku kebakaran yang melampau dengan angin aliran keluar yang kuat yang mampu menumbangkan pokok dan memulakan kebakaran baharu. Ini adalah situasi yang sangat berbahaya bagi pemadam kebakaran.) V2hlbiBpdCBkZXNjcmliZXMgYSB2ZWhpY2xlLCB3aGF0IGlmIHRoZXJlJ3MgbXVsdGlwbGUgdmVoaWNsZXMgdGhhdCBmaXQgdGhlIGRlc2NyaXB0aW9uIGluIHRoZSBhcmVhPwoK 输出 content 的值。=== Development environments === The most popular development environment for Text is named Notepad, and comes default with Windows. It is simple, yet powerful, compiling and running the program as you type it. Other development environments for Text include Leafpad (Linux), Wordpad (Windows), Notepad Desmos (Desmos), Emacs (Cross-platform), VSCode (Cross-platform) and Vim (Cross-platform). == See also == * [[Quine (programming language)]], the exact same thing * [https://tio.run/##fZBBT4QwEIX/CqkeWoEu61HsGuPVg8kesck2pUC1ts204MH425FCspo9@C6TfPPeS2bexCSCBO1jaV2r5tmomAkA5sFJFQIV0E/NLafBGx0xQoR@CI@BHYDKQcDTEnqMuCKkaHXXsYbXnQOcWoBVNdwvXdQo28ehhjwnyUT9GAa8LBrg5TrKPSd1WjUVZ4lUvHBjZEig/@skW1PAC3moHpZIzpBGFJRXImJJ7jbUnlG5v5Gk2GiHaulscEZR43p8uspeQNsYMnT9dXH@N3q1p3yJpR4jpMI7nbTrdYGm5Sln3Cat@PMv/jW3l@7NrBEh9TzPxzh63R6jkO/Pwvaj6NUP Text compiler] to [[StupidStackLanguage]]. [[Category:Joke languages]] [[Category:2007]] [[Category:Implemented]] [[Category:Total]] [[Category:Unusable for programming]]