Skip to main content
Fixed link
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142

Forte, 49 60 bytes

3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END 

Try it online!

Forte is a weird and wonderful language with BASIC-like syntax and an execution model based on redefining integers. It has no conditional or looping constructs; to get conditional or looping behavior, you have to redefine the line numbers your program uses.

How?

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.

If the user inputs a one... it gets interesting.

3 LET 5=5+(0*4) 

The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.

4 INPUT 0 : LET 6=6-(0*4) 

INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1; 6->2

5 PRINT 0 : LET 3=3+(0*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.

Redefinitions: 0->1; 6->2; 3->7

Next, we increment the instruction pointer and execute the command on line 3 7:

3 LET 5=5+(0*4) 

which redefines 5 to be 5+4...

Redefinitions: 0->1; 6->2; 3->7; 5->9

... and we execute line 5 9:

5 PRINT 0 : LET 3=3+(0*4) 

which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.

For those who are still confused, read the Esolangs article or ping ais523ais523 (the language's inventor!) in chat.

Forte, 49 60 bytes

3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END 

Try it online!

Forte is a weird and wonderful language with BASIC-like syntax and an execution model based on redefining integers. It has no conditional or looping constructs; to get conditional or looping behavior, you have to redefine the line numbers your program uses.

How?

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.

If the user inputs a one... it gets interesting.

3 LET 5=5+(0*4) 

The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.

4 INPUT 0 : LET 6=6-(0*4) 

INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1; 6->2

5 PRINT 0 : LET 3=3+(0*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.

Redefinitions: 0->1; 6->2; 3->7

Next, we increment the instruction pointer and execute the command on line 3 7:

3 LET 5=5+(0*4) 

which redefines 5 to be 5+4...

Redefinitions: 0->1; 6->2; 3->7; 5->9

... and we execute line 5 9:

5 PRINT 0 : LET 3=3+(0*4) 

which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.

For those who are still confused, read the Esolangs article or ping ais523 (the language's inventor!) in chat.

Forte, 49 60 bytes

3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END 

Try it online!

Forte is a weird and wonderful language with BASIC-like syntax and an execution model based on redefining integers. It has no conditional or looping constructs; to get conditional or looping behavior, you have to redefine the line numbers your program uses.

How?

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.

If the user inputs a one... it gets interesting.

3 LET 5=5+(0*4) 

The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.

4 INPUT 0 : LET 6=6-(0*4) 

INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1; 6->2

5 PRINT 0 : LET 3=3+(0*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.

Redefinitions: 0->1; 6->2; 3->7

Next, we increment the instruction pointer and execute the command on line 3 7:

3 LET 5=5+(0*4) 

which redefines 5 to be 5+4...

Redefinitions: 0->1; 6->2; 3->7; 5->9

... and we execute line 5 9:

5 PRINT 0 : LET 3=3+(0*4) 

which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.

For those who are still confused, read the Esolangs article or ping ais523 (the language's inventor!) in chat.

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Forte, 49 60 bytes

3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END 

Try it online!

Forte is a weird and wonderful language with BASIC-like syntax and an execution model based on redefining integers. It has no conditional or looping constructs; to get conditional or looping behavior, you have to redefine the line numbers your program uses.

How?

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.

If the user inputs a one... it gets interesting.

3 LET 5=5+(0*4) 

The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.

4 INPUT 0 : LET 6=6-(0*4) 

INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1; 6->2

5 PRINT 0 : LET 3=3+(0*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.

Redefinitions: 0->1; 6->2; 3->7

Next, we increment the instruction pointer and execute the command on line 3 7:

3 LET 5=5+(0*4) 

which redefines 5 to be 5+4...

Redefinitions: 0->1; 6->2; 3->7; 5->9

... and we execute line 5 9:

5 PRINT 0 : LET 3=3+(0*4) 

which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.

For those who are still confused, read the Esolangs article or ping ais523ais523 (the language's inventor!) in chat.

Forte, 49 60 bytes

3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END 

Try it online!

Forte is a weird and wonderful language with BASIC-like syntax and an execution model based on redefining integers. It has no conditional or looping constructs; to get conditional or looping behavior, you have to redefine the line numbers your program uses.

How?

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.

If the user inputs a one... it gets interesting.

3 LET 5=5+(0*4) 

The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.

4 INPUT 0 : LET 6=6-(0*4) 

INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1; 6->2

5 PRINT 0 : LET 3=3+(0*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.

Redefinitions: 0->1; 6->2; 3->7

Next, we increment the instruction pointer and execute the command on line 3 7:

3 LET 5=5+(0*4) 

which redefines 5 to be 5+4...

Redefinitions: 0->1; 6->2; 3->7; 5->9

... and we execute line 5 9:

5 PRINT 0 : LET 3=3+(0*4) 

which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.

For those who are still confused, read the Esolangs article or ping ais523 (the language's inventor!) in chat.

Forte, 49 60 bytes

3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END 

Try it online!

Forte is a weird and wonderful language with BASIC-like syntax and an execution model based on redefining integers. It has no conditional or looping constructs; to get conditional or looping behavior, you have to redefine the line numbers your program uses.

How?

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.

If the user inputs a one... it gets interesting.

3 LET 5=5+(0*4) 

The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.

4 INPUT 0 : LET 6=6-(0*4) 

INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1; 6->2

5 PRINT 0 : LET 3=3+(0*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.

Redefinitions: 0->1; 6->2; 3->7

Next, we increment the instruction pointer and execute the command on line 3 7:

3 LET 5=5+(0*4) 

which redefines 5 to be 5+4...

Redefinitions: 0->1; 6->2; 3->7; 5->9

... and we execute line 5 9:

5 PRINT 0 : LET 3=3+(0*4) 

which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.

For those who are still confused, read the Esolangs article or ping ais523 (the language's inventor!) in chat.

Fixed
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142

Forte, 4949 60 bytes

2 LET 4=4+3LET5=5+(0*30*4) 3 INPUT 04INPUT0:LET6=6-(0*4) 4 PRINT 05PRINT0:LET 2=2+LET3=3+(0*30*4) 6END 

Try it online!Try it online!

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the twothree LET statements don't dochange anything, and the program boils down to PRINT 0 : END.

23 LET 4=4+5=5+(0*30*4) 

The first time around, no numbers have been redefined yet; this line calculates 4+5+(0*30*4) and assigns that to 45. Nothing changes.

34 INPUT 0 : LET 6=6-(0*4) 

ReadINPUT 0 reads a number from the user and redefineredefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1>1; 6->2

45 PRINT 0 : LET 2=2+3=3+(0*30*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*30*4 is now 1*31*4, so we have LET 2=53=7.

Redefinitions: 0->1; 26->5>2; 3->7

Next, we increment the instruction pointer and execute the command on line 23 57:

23 LET 4=4+5=5+(0*30*4) 

which redefines 45 to be 4+35+4...

Redefinitions: 0->1; 26->5;>2; 43->7>7; 5->9

... and we execute line 45 79:

45 PRINT 0 : LET 2=2+3=3+(0*30*4) 

which should be read (with substitutions) as 79 PRINT 1 : LET 5=5+7=7+(1*31*4). We print another 1 and change 57 to 811, which means we execute the original line 23 again, and so forth.

Forte, 49 bytes

2 LET 4=4+(0*3) 3 INPUT 0 4 PRINT 0:LET 2=2+(0*3) 

Try it online!

If the user inputs a zero to this program, the two LET statements don't do anything, and the program boils down to PRINT 0.

2 LET 4=4+(0*3) 

The first time around, no numbers have been redefined yet; this line calculates 4+(0*3) and assigns that to 4. Nothing changes.

3 INPUT 0 

Read a number from the user and redefine 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1.

Redefinitions: 0->1

4 PRINT 0:LET 2=2+(0*3) 

First, this line prints 1 (the value that 0 now represents). Then, 0*3 is now 1*3, so we have LET 2=5.

Redefinitions: 0->1; 2->5

Next, we increment the instruction pointer and execute the command on line 2 5:

2 LET 4=4+(0*3) 

which redefines 4 to be 4+3...

Redefinitions: 0->1; 2->5; 4->7

... and we execute line 4 7:

4 PRINT 0:LET 2=2+(0*3) 

which should be read (with substitutions) as 7 PRINT 1:LET 5=5+(1*3). We print another 1 and change 5 to 8, which means we execute the original line 2 again, and so forth.

Forte, 49 60 bytes

3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END 

Try it online!

Here's the code with better spacing:

3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END 

If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.

3 LET 5=5+(0*4) 

The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.

4 INPUT 0 : LET 6=6-(0*4) 

INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.

Redefinitions: 0->1; 6->2

5 PRINT 0 : LET 3=3+(0*4) 

First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.

Redefinitions: 0->1; 6->2; 3->7

Next, we increment the instruction pointer and execute the command on line 3 7:

3 LET 5=5+(0*4) 

which redefines 5 to be 5+4...

Redefinitions: 0->1; 6->2; 3->7; 5->9

... and we execute line 5 9:

5 PRINT 0 : LET 3=3+(0*4) 

which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.

Updated TIO link
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142
Loading
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142
Loading