Conversation started Sep 1, 2021 at 0:01.
Sep 1, 2021 00:01
Welcome to the first Learn You A Lang For Great Good event! This time, the language is Quipu, a language inspired by Inca knotted strings! During the next 24 hours or so, feel free to suggest Quipu-inspired CMCs, ask questions about the language, or otherwise discuss it! You can find an interpreter for it here
9
@emanresuA Nope, still times out for n = 5 for me :P
And with that, I should head to bed o/
To distinguish Quipu challenges from regular CMCs, I say let's call them QMCs
3
Nice
QMC: Incrememnt a number
Oh man writing Quipu programs is going to be so trippy with the different knots
so it looks to me that operations are basically postfix, and other threads are needed for loops and functions?
Sep 1, 2021 00:05
0
Q: Draw constraint system #18762389

BubblerBackground Page 219 of A New Kind of Science (a book by Stephen Wolfram, the creator of Mathematica) shows an interesting 2D pattern generated by constraints. The relevant section in the book starts at page 210; you can browse other pages for more context. In short, the large binary image is the...

\/
1&
++
/\
can't exactly post TIO links
@JoKing Yeah. Each thread is kind of a cross between a variable and a goto label. It has a value, and also it's a series of statements that you can jump to. Other than jumps, execution goes top to bottom, left to right.
QMC: Output the numbers 1 through 10.
(Maybe we should post the reply comment separate from the actual answer--that way the answer can use fixed font.)
When the documentation says knot n - 1, does that mean the previous knot, or the n-1th knot (using the value of the previous evaluation?)
No clue
wait so do knots have a separate stack or do they only have a single current value
Sep 1, 2021 00:13
QMC: Throw an error./
@emanresuA NO
@JoKing n-1 means the previous knot; (n-1) means the value of the previous knot.
(preferably not a synaz eror)
@emanresuA //
ooh, i keep mixing up knot n-1 and thread n-1
Sep 1, 2021 00:14
@exedraj ^^^
So for instance "jump to thread (n-1)" means "get the value K of the previous knot, then jump to the Kth thread"
@DLosc what does it mean by This knot merges with n - 2 and n - 1.?
@exedraj That's the most confusing wording choice IMO
well what does it mean?
patience, I'm typing :)
I would explain it as "This knot forms a compound knot with the previous two knots." Sort of like how Jelly has some quicks that combine the previous two links.
Sep 1, 2021 00:19
that still doesn't make much sense. like how does it combine the previous two knots
So if you have something like this:
\/
1&
==
2&
**
Consider the ==, which means "jump to thread (n-1) if (n-2) equals zero."
In this program, n-2 is the input, and n-1 is a constant 1
So the == tests if the input equals zero. If it is equal to zero, execution jumps to thread 1
does it set the value of the current thread to the input if it jumps?
Wait so is \/ / == / whatever a knot or a thread?
@JoKing It sets the value of the current thread to the value of the last knot evaluated if it jumps, IIRC
Is Quipu TC?
Sep 1, 2021 00:23
the last knot is the jump right?
@exedraj \/ is a knot. A column of knots is a thread.
It has finite memory, right?
@JoKing Yes, which is one reason why it's important to know what the == evaluates to.
@emanresuA It uses unbounded integers, so theoretically it has infinite memory.
Oh I see, cool.
So is TC?
Yes, I think so. But programming something that requires an arbitrarily sized list of integers would be quite a pain.
Sep 1, 2021 00:24
you could probably simulate a stack by jumping to the same thread over and over again?
@JoKing Only if you store the stack encoded as a single integer
does a jump return to the original thread after the thread has been completed? does the the original thread retain the value it had or the new value? one of these assumptions is probably wrong
@DLosc incoming, 35 bytes
1&
++
/\
\n
/\
^^
1&
++
1@
%%
0#
>>
Ooh, interesting! I wasn't expecting a single-thread answer
without the newline it would be a about five lines shorter
Sep 1, 2021 00:31
@JoKing No, a jump is just a goto, it doesn't return. Each thread retains its value whenever it's not executing. Does that answer your question?
i think so. i was thinking of it as recursion i.e. insert a copy of the other thread into this thread
no stack simulation then
i really wish there was a evaluate to (n - (n - 1)) knot
@JoKing Yeah, I get why they're called threads for thematic reasons, but it does seem easy to confuse them with threads. Quipu threads are basically just blocks of code, but vertical (and with associated values).
QMC: Given a number N, count up from 1 to N. Or, if you prefer, you can start at 0, or stop at N-1.
oh god, you're bringing input into this
You gotta start using multiple threads sometime! ;)
1&
++
/\
\n
/\
^^
1&
++
\/
%%
0#
>>
I thnink
stolen from joking annd ssligthy modified
Sep 1, 2021 00:41
umm, i don't think the input knot will keep returning the same thing?
Oh
Dammit
(Requires n copies of n to be inputted)
You'll have to take input once and store it.
what does \/ evaluate to at EOF?
Not sure, but emanresu A's code results in a type mismatch error, so... not a number.
Sep 1, 2021 00:45
so does 'merge' mean that (n-2) will skip over the clump of knots? and (n-1) refers to that clump? that seems to make sense
Does Quipu have any string handling?
Aside from ' and stuff
Like int-to-char, concatenate, etc?
apart from pushing and printing, i don't think so :(
z;9
That pan
Is someone going to create the LOTM post?
I can if no one's started yet
Go ahead
Ooh, I must document "QMC" in the wiki
Sep 1, 2021 00:48
Ok
@JoKing It's null in the Scala interpreter
oof. is there even a way to check for that
@DLosc 64 bytes, but should be golfable
\/1&
  ++
  /\
  \n
  /\
  ^^
  1&
  ++
  0&
  []
  %%
  1&
  >>
@JoKing I believe that's right, but I haven't tested it
this program confirms it with []
Aha
Sep 1, 2021 00:53
now i really wish there was a copy of (n-2) so i could save a couple of lines with the newline printing
Yeah. I tried a version using an extra thread, but it cost more bytes that way because of the indentation. Although, I didn't know the spaces between threads were optional...
Aha! It is a bit shorter!
62 bytes:
\/1&\n
  ++/\
  /\1&
    []
    0&
    []
    --
    1&
    <<
 
Conversation ended Sep 1, 2021 at 1:02.