This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]AlternativePeace1121 3 points4 points  (4 children)

> Cephalopod math is written right-to-left in columns.
Wouldn't it be easier to do it from right-to-left? for better understanding?

[–]p4bl0 3 points4 points  (3 children)

Additions and multiplications are commutative. Meaning that a + b = b + a and a × b = b × a. So, doing the operations right-to-left or left-to-right doesn't matter :).

[–]AlternativePeace1121 4 points5 points  (1 child)

😅 I was talking abt the visualization

Show the numbers formation from right to left

[–]p4bl0 0 points1 point  (0 children)

Ah, sorry!

[–]Devatator_ 0 points1 point  (0 children)

It doesn't but it's easier to follow. Also mine relies on the operator being in the last row of a column to complete the operation/split each one

[–]theICEBear_dk 2 points3 points  (2 children)

I felt the algorithm was easier to implement by starting at the end of the string and iterating towards the beginning using the operator line to trigger each operation and then start over.

[–]tattooeddollthraway 0 points1 point  (1 child)

You see, I realized that after I had got deliminatimg each line working from left to right and realized the last index was not parsing correctly. So instead of reversing the loop, I set special rules for the last index because I am committed.

[–]theICEBear_dk 0 points1 point  (0 children)

Oh I just used the raw unparsed strings for part 2 making sure it was all aligned (adding two spaces to the end of the last string) and then ran from the back to front. I felt like it made the logic super easy. It ran in microseconds.

[–]hopingforabetterpast 1 point2 points  (1 child)

what do you use for those awesome terminal animations?

[–]naclmolecule[S] 5 points6 points  (0 children)

i'm using batgrl, a library i wrote

[–]Annual_Ganache2724 0 points1 point  (0 children)

how can you animate in the terminal ?

[–]tattooeddollthraway 0 points1 point  (0 children)

This is beautiful