« first day (2 days earlier)    last day (62 days later) » 

02:09
@Steffan i try it but it doesnt seem to handle smth like ; OUTPUT "foo\" OUTPUT "bar" properly
the backslash suppose to make output with no newline but foo\nbar is output instead
correct output is foobar
02:35
i dont even get what semicolon does but im still making functioning programs somehow lol
just putting semicolons in random spots until stuff works XD
and sometimes semicolons arent even needed, cant make any sense of it
@AidenChow Well you know that semicolons are in polish notation too, right?
So it takes two args and returns the sec
@AidenChow that's because the code is given with JS backticks so it gets rid of them
just double-escape the backticks and then don't count the double in the byte-count, ofc
actually, imma hack it so the code goes in cmd args
02:51
bro i have no idea what im doing, im just ctrl f in the specs
and then just putting semicolons in random places until my code works
lol
https://tio.run/##lVhrc9s2Fv2@v4LmphYh0rSc6bQT0bQncZ1Opo2cxm4zu5ISgSAksaFAhQ/bqcT96917wReol9N8yIjAwX3h3Af8J72nCYuDZXoiIp//zUKaJNovIpjN0@s4jmKNP6Zc@Ikmv1Z5AXhH44S395UzFep9JtJg8TTuNo05XaxYJJI0zlgaxQYlq3QeJHYSZTHjLs1hJ1h@mAcpT5aUcaPcX9CUzY3Tj8ZwNB4NRwms5/2xuf738ONIjLvGSKyfEdI9JfmS88@wG/M0i4WmCB/2xuu1yMIwL4R5FnN7ZBXyVKOuZ/NHzgwFTpxSBB5xXZde4o@@CnGV33aSeWC7QUGNHXIxS@fEokM2JnkageOBmO20Ks9lOLS7/7y7vnWHY6cI1R80zPgqSWkaMG2Jt2B4ZOXZW@FxphDFexqDDz2HnksxpX6HmmbhH3Pl@pCO7UqWE0wNRkp7WK74mseZkGGPowdN8IeCEbnPvWy2Y32Pd1KI3WwCbpAtPB7vwVWbgHsVRSGnYg@w3s1LVv0KwYhpWBOvCN0GyZJsidItKeqTT1MKXCscVZTscKb8bs7t8qT8boO
use dat
@AidenChow that's not how you do it lol
so like do you even know how the lang works lol i bet you dont
@Steffan ye u just put function name and then the arguments and stuff, then the semicolon just magically makes ur code work :P
and then sometimes add whitespace cuz stuff breaks if u dont
a number can be part of a var name so you need space there
so =c0 doesn't work, u need =c 0
@Steffan OH thats why
i was just adding a space cuz that usually fixes things lol
tried adding a semicolon there but it didnt really work
and like O is the same as OASDASD is the same as OUTPUT so u need space
: is the identity function, basically equiv to whitespace
takes an arg and returns it, so if u hate whitespace then use : lol
also stuff like parens and brackets are ignored
the c interpreter segfaults on everything so that's why I like the JS one better
02:57
wait why it ignore parentheses
because they're redundant
just for readability
but like how u do math stuff without parentheses
everything has fixed arity
so a+b is +a b as u know
so what is +*- 1 2 3 4?
@Steffan i have no clue
(1-2)*3+4
because everything takes two args
or those do
so first u parse - 1 2 which is 1-2
then *- 1 2 3 which is (1-2)*3
then the add
it's polish notation
Polish notation (PN), also known as normal Polish notation (NPN), Łukasiewicz notation, Warsaw notation, Polish prefix notation or simply prefix notation, is a mathematical notation in which operators precede their operands, in contrast to the more common infix notation, in which operators are placed between operands, as well as reverse Polish notation (RPN), in which operators follow their operands. It does not need any parentheses as long as each operator has a fixed number of operands. The description "Polish" refers to the nationality of logician Jan Łukasiewicz, who invented Polish notation...
03:00
kinda weird but ok
wikipedia might be able to explain better than me :p
ok so does this make any sense at all yet
i bet it doesn't
ok so the entire lang is based off this weird notation????
@Steffan errrr... tbh no
yeah
there's other langs that are same way, like Pyth
im more used to seeing stuff like f(x) = blah blah blah lol
03:03
so like what does semicolon have to do with this notation
it's just to separate things
; a b returns b
so statement separator
wait what, so it skips a and then just runs b??
it runs a as well
so if u want to do x=3;y=3, you can't do =x 3 =y 3, you have to do ;=x 3=y 3 (or =x=y 3)
so let's say you have a while loop, you have to know which statements are in the while loop and which aren't
@Steffan hmmmmmmmmmm.... why not
so confused lol
You need a way to separate statements
So if you have a while loop with two satements, how's it gonna know what to put in the loop?
So the while loop takes one statement
And you can combine them with ;
So like in your answer W1O1, the while loop takes one statement, O1. What if you wanted to output smth else too?
You would do W1;O1O2
03:08
@Steffan umm i just put it in a string??
ok yeah you could do that in that case
what if u want to set a var
or put another while loop in there as well
bro idk enough of the language to figure that one out
just like put it there ig
but what if you also want to output
if you just do W1{some random statement}{some random statement} how does it know what to do? Does it do the last statement outside or inside of the loop?
bruh i give up lol
@Steffan i mean maybe they implement that with the whitespace, like maybe space between the two statements to indicate the last statement isnt part of the while loop or smth like that, this semicolon stuff is like way too confusing, i still dont understand it
bruh
you need space for other stuff too
and that would be so ambiguous and confusing
03:14
not as confusing as this semicolon
this is meant to be a simple lang that can be implemented easily in many langs, not some comp lang with indentation and stuff
idk why u dont understand semicolon lol
It's a function just like every other function in Knight
It takes a, b, evaluates a, and returns b evaluated
@Steffan ok that just seems like it does nothing
bruh
like just do a b or smth like that no need for semicolon
in a sense, yes
@AidenChow but u have to know what goes where
does it go in the loop or not
03:18
@Steffan yea well that would be an issue, but semicolon seems like weird solution to me, just utilize the whitespace or smth like that, much clearer
like its just confusing, just put semicolon at the start of ur code and boom ur code just work
03:53
whitespace would be so confusing lol
like how do you tell what on earth it means
i wish knight had scoped vars. it makes recursion pretty much impossible
because u recurse and ur vars get overriden
04:04
whats the best way to differentiate a num from a str
@Steffan i could say the same thing about semicolons lolol
 
4 hours later…
07:57
do u guys know of a good way to coerce a number into a string
nvm i figured it out, just add empty string to the num
lol idek how this works anymore, but it somehow works: codegolf.stackexchange.com/questions/219576/…
08:39
can't you do ASCII on a char to get 100
@Razetime shoot i actually forgot ascii works both ways
thats embarrassing
ok i edited it, -8 bytes -_-
09:16
Minifier: bit.ly/3vHi07R
Does variable renaming, whitespace removal and builtin name golfing
@emanresuA O_O wow nice, but i already code minified lol (is that normal?)
09:36
¯\_(ツ)_/¯
09:50
@AidenChow the coercion may turn up on some other challenges however. worth writing a tip for it
@Razetime eh maybe, ill write one up if i have time
 
13 hours later…
23:15
@AidenChow Num check could be like this, I think (not tested): ?+x"0"x

« first day (2 days earlier)    last day (62 days later) »