Indifferent

From Esolang
Jump to navigation Jump to search

Indifferent (the lesser twin of of two "Flux and Indifferent" as Indifferent has less features compared to Flux {Indifferent code can work on a Flux interpreter but not the other way around} ) is a minimalistic approach for traditional control flow programming with around 11ish features Indifferent prototype was compleate on April 20th, 2024 and made by user Scudmaster11 ... no IRL name sorry ;)

the features are

! ... inside this action (!) we first do (1 or 2) to say how many things are happening... 1 is a direct set and 2 has a math operator tied to it (- +) ? is a number, ! is an address, @ is an address based apon a number inside another address (inside 1 action... user input also is a thing (^) (not working in prototype)

if we want to set address 1 to 5 its

!1?5!1 (we start with action (!) and 1 set action... ? is a number (number 5)... and we are setting it into address 1 with a closeing (!1)

if we want to add numbers its

!2?1!1+!1 (! {2} ((?1 !1 +) !1) )

? (if statement) > (grater then "only comparison operation built into the language" {all i can say is good luck with only > ... it is possible to make = and != but it takes work} ) {::index:: }::index:: [::index::

?(condition)>{::index:: ::code:: }::index:: ::code:: [::index::

when we do a condition... its set up basically the same way as the set action just without (1 or 2) and always ended with a >

all the index based stuff as for nesting fallowing by the extractor and interpreter so for the index... a number is put in there for the ID of that level for the if statement (more then one of the same ID based indexed if statement can be in the same code but not nested into each other)

{::index:: always has to be there right after the > }::index:: is (else) of said if statement index (this can lead to non linear control flow to where index if statement 1 can end before the nested if statements and have the nested if statement code still run)  ??1?1>{1??1?0>{2 ::code for index 2 if statement:: }1 ::code:: [1 ::code:: }2 ::code:: [2


(. # ])

(. # and ]) are add location and goto location (also based apon indexing) (. #1) is index 1 for a area (thies are global and the same index cant be used)... and to call # its ]::index:: or ]1 for that #1

(Hello World! code)

"Hello World!"end"


(outputs)

to output like a print... its "::text::"end" to print out a number in address its $::location:: to print out as a character in address its %::location::

0 bitwise operators and math operations cant occur inside if statements

Fibonacci sequence code (this prints the first 11 in the sequence)

!1?1!1 "0"end" " "end" !1?1!2 !1?0!3 #1 ??5!3>{1 $1 " "end" !2!1!2+!2 $2 " "end" !2!1!2+!1 !2?1!3+!3 ]1 [1


when extracted (prepared for interpretation) it looks like

!1?1!1" 0" !1?1!2!1?0!3??5!3>§68$1" !2!1!2+!2$2" !2!1!2+!1!2?1!3+!3§23

(prime number generator "between 1 and 100") !1?1!1 !1?5!2 #1 ??100!1>{1 !1!1@2 !2?1!1+!1 !2?1!2+!2 ]1 [1 !1?6!1 #2 !1@1!2 !1@1!3 ??105!1>{1??1!2>{2 !2?1!1+!1 ]2[2 #3 !2!2!3+!2 ??105!2>{2 !2?4!2+!4 !1?0@4]3 [2 !2!1?1+!1 ]2 [1 !1?6!1 #4 !1@1!4 ??105!1>{1 ?!4?0>{2 !1@1!2 $2" "end"[2 !2!1?1+!1 ]4 [1


(if you want it abit easier to read each symbol.. here you go) ! 1 ? 1 ! 1 " 0 "  ! 1 ? 1 ! 2 ! 1 ? 0 ! 3 ? ? 5 ! 3 > § 68 $ 1 "  ! 2 ! 1 ! 2 + ! 2 $ 2 "  ! 2 ! 1 ! 2 + ! 1 ! 2 ? 1 ! 3 + ! 3 § 23

(there is 0 error handleing... so if there is an error {a symbol that can be interpreted but not properly formatted it will just run the code properly "it wont know what to do with it".. if a index on an if statement isn't properly closed... the program will basically forever trying to look for the end... if its a symbol that isn't apart of the interpreter itself... it will just 100% ignore it as its not apart of the extractor or the interpreters abstractor {in the prototype right now that is} )

if you need alittle more help from me with trying to understand... please send me a message on YT or maybe here and ill try to help you out

(updates for hopefully easier to understand) ""sorry the earlier one is harder to read""

! set commands... if they are fallowed by a 1 (!1) it means we are setting 1 address to another address or a number... if by a 2... its 2 addresses/numbers with a math operation (- +) and after that... inside them we have 3 options for addresses/numbers (?!@) (? is a number) (! is an address) (@ is use a number inside an address for another address) example (!1?2!3) set action 1 (!1)... number 2 (?2).. and put it into address 3 (!3) example 2 (!2?1!3+!3)... (set action 2 (!2)... number 1 (?1) and address 3 (!3) and add them together and store result into address 3 (!3)... the (?number , !address, and @address from another address) methods are also used in if statements... there is also userinput (^) !1^!1 (set command 1... ^ userinput {this is real time as both Indifferent and Flux lack large strings and only operate apon 1 at a time real time keyboard input)... ^ doesn't need a number by it (so please dont put one next to it... Extractor wont really know what to do... and will just... fail causing a crash in the code and reading ! or ? addresses and numbers as set address and if statements... because now the code is out of sinc with the interpreter)... user input ^ is only on !1 set command and not supported in !2 set command (user input fixed... here is a simple code for it

  1. 1 !1?0!1 !1^!1 ?!1?0>{1 %1 [1 #2 ?!1?0>{1 !1?0!1 !1^!1 ]2 [1 ]1

)

? if statements if statements only have > for their only comparison method so make sure to get creative to make = and != they are indexed and much always be closed... {::index/number:: after the condition for the if statement... }::index/number:: is else... and [::index/number:: closes the if statement (make sure to use the same index on each... as they represent that if statement... so if it was index 1... it much be {1 }1 [1 ... thies are local (so we can have more then one 1 index if statement... as long as they arn't nested) "0 bitwise operators"

example...  ?(condition){1 ::code:: }1 ::code:: [1 or...  ?(condition){1 ::code:: [1

  1. and ]
  2. and ] also known as listener and speaker... #::index/number:: sets down a area to jump to when called (like a goto)... ]::index/number:: goes to the # of that number (thies are global and only one can be used in one peice of code... so dont over use them)... # and ] are the only way to create loops as because of the lack of built in loops

example of loop and method #1??5!1>{1!2?1!1+!1]1[1 (ill add spaces between each command for easier reading) #1 ??5!1>{1 !2?1!1+!1 ]1 [1

last is output methods to print a string out its just "Hello World!"end" quotes for starting and then for ending its just the word end enclosed in quotes "end"

there is also $ and % $::number:: will take the number inside the address with ::number:: and print it %::number:: will take the number inside the address with ::number:: convert it to a text character and print it (there is 76 characters)

example $1 (will look up address 1... and print its number it carries) %1 (will look up address 1... convert its number to a text character... and print it)

(hopefully Alpha will roll around at some point)