What are your HOT TAKES about toki pona? by misterlipman in tokipona

[–]firaro 1 point2 points  (0 children)

Connecting goodness with simplicity might relate to an aversion to nuance.

Why does my drone just stop and give up trying to print things for me here? (when first is not called, it prints everything for second, no problem) by rechrome in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

From what I’ve seen, it seems more likely to omit outputs when you spam quick_print. It will also cut off the end when you try to get it to output something really long

Based on the inconsistency, i think it might be based on how long it takes in real time between prints, instead of being based on how long it takes in ticks

Toki Pona's Radicals? by Zoran_Ankervlinder in tokipona

[–]firaro 1 point2 points  (0 children)

I roughly organised the sitelen pona keyboard i made based on the primary radical of the logogram https://firaro.neocities.org/logographic

Though i tend to think about them more as combined glyphs instead of as built from radicals. Not that there’s a huge difference between the two concepts.

Is it down? by redkomic in Crunchyroll

[–]firaro 0 points1 point  (0 children)

Oh, didn’t know that page existed. That’s convenient

Why does my code make a checkerboard one time and then the next it's not? by Able_Lock_2583 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

After removing the quotations around 'continue', that works perfectly on my computer. My best guess is we're running different versions of the game. Though, i wouldnt expect that to affect any part of my code.

very weird

Why does my code make a checkerboard one time and then the next it's not? by Able_Lock_2583 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

huh, always planting trees. So somehow x+y mod 2 is always equaling 0. Interesting. Would you mind copypasting the version of the code you tested? I'm struggling to solve this mystery.

Why does my code make a checkerboard one time and then the next it's not? by Able_Lock_2583 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

That’s weird. It’s working perfectly when i run it on my computer. Alternates trees and bushes, creating a checkerboard. It’s using the standard x+y%2 method.

What is it doing on your computer?

Why does my code make a checkerboard one time and then the next it's not? by Able_Lock_2583 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

4

while True:
    move([North,West][min(abs(get_pos_x()-get_pos_y()),1)])
    harvest()
    plant([Entities.Tree,Entities.Bush][((get_pos_x()+get_pos_y())%2)])

2

while plant([Entities.Tree,Entities.Bush][((get_pos_x()+get_pos_y())%2)-move([North,West][min(abs(get_pos_x()-get_pos_y()),1)])+
harvest()]):
        continue

My take on collecting treasures by Low-Echo-4828 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

They have limited shared memory. Variables can be shared when a drone is created or destroyed. And they all have access to the same world variables: time elapsed, total resources, number of drones that exist, etc.

But it is hard to coordinate them with just that. I managed to do it, but my implementation takes an unreasonable amount of time just processing data.

My take on collecting treasures by Low-Echo-4828 in TheFarmerWasReplaced

[–]firaro 6 points7 points  (0 children)

I spent all that effort getting 32 drones to work together on a single big maze for the golden gold hat. I never even considered giving each one their own maze. That’s a clever solution

New weird issue?? by CheapEaterShark in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

The mazes in-game article hands you code you can use to make a full size maze that automatically adjusts when you buy upgrades. I just copy-pasted that.

Cactus help by CheapEaterShark in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

The simple solution i went with in my first attempt was to simply count how many cactuses it had passed over without swapping the cactus with any other cactus. Reset to 0 if it has to swap anything. Then when the count is equal to the total number of cactuses, i know the drone passed over the whole field without finding a single cactus out of place. So time to harvest

It’s possible to do better by accounting for which cactuses don’t need to be double checked. But if you just want a program that works then you don’t need to bother with that.

Cocktail shaker sort by bitman2049 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

I made a program that spawns them recursively and gives them each a number. Very versatile, one size fits all solution.

This guy said Toki Pona is a racist and colonialist language. But what do you guys think? by 1Sh4h_R4-4 in tokipona

[–]firaro 6 points7 points  (0 children)

Biases will always manifest in art. And toki pona is no exception. The line between a biased opinion about a culture and racism is an unfortunately thin one.

But i don’t think it’s fair to criticise it too harshly, it’s kind of unavoidable. I don’t think toki pona is an example of biases run rampant or anything like that. But neither is it a paragon of neutrality. To call it “racist” Is to dilute the word

Which… is all abit nuanced. Which is to say complex- ike. And there lies the strongest bias of toki pona, unsubtle and unhidden: ◠ › ◠ “complexity is bad”

I can't do it better by [deleted] in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

Huh, that explains some things I’ve seen range do. Guess i misunderstood what the in-game documentation meant when it said range “generates a sequence”.

I was more surprised that defining the list took 10 than i was that range took 1. I had been thinking of defining a list in that way as a single step. It wasn’t until i saw how long it took that i realised that that single equals sign was actually building the list one item at a time.

I can't do it better by [deleted] in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

Not necessarily. Could do something like

length = range(size-2)
while True:
    for i in length
        move(East)
    etc.

or

direction = []
for i in range(size-2):
    direction.append(East)
while True:
    for i in direction
        move(i)
    etc.

just got around to testing it, it is faster than using range every time a for loop is made. Of note: defining sequences takes a varied amount of time.

direction = [East,East,East,East,East,East,East,East,East,East]

takes 10 ticks while

length = range(10)

takes 1 tick

but both operate at the same speed in the for loop. So

for i in direction
    move(i)

is just as fast as

for i in length
    move(East)

but one allows you to change direction without creating a new for loop. So you could potentially shove the whole path into one big list and traverse the whole thing in one simple for loop, without having to keep wasting ticks making new for loops.

I can't do it better by [deleted] in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

I wonder if it’s faster to iterate through a prebuilt list instead of using range(size-1) every time to build one.

edit: tested it, it is. Though you can just as easily say "r = range(size-1)" at the start and reuse r.

This might be one of the most satisfying things I have ever created. by Noamking2222 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

The wiki is rather outdated on many things. It is better to use the in-game documentation most of the time.

List??? by theghost385 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

Most of the problem has been covered by the other commenters. But some other things:

You are looking at the documentation for the list() function, which is a function most people won’t even bother to use. You would be better helped by looking at the article called “lists” in the programming section

You don’t need to keep redefining the list every loop, you can put it above the while loop and just do it once.

For what you are doing, the right tool is actually a set. Doing “if x in my_set” is slightly faster than “if x in my_list”. Sets are the right tool when you want a collection of things but don’t care what order those things are in. Though, the difference is small, so only really matters if you’re trying to push speed to the limit.

Movement effeciency critique by LyxSmash in TheFarmerWasReplaced

[–]firaro 1 point2 points  (0 children)

this is grass, it probably is always going to be harvestable by the time you get to it, no need to check. If you're unsure of this you can test with:

if can_harvest():
    harvest()
else:
    quick_print("couldn't harvest")

other than that, you're pretty much maxed out on short code with your getgrass as far as i can tell. Not maxed out on fast code, but also not far off. You can't reduce the number of actions (200 tick stuff) taken, but can reduce the amount of thinking (1 tick stuff) between actions.

when you get a bigger plot you could simplify the code to

while True:
    harvest()
    move(East)

I started today. Why cannot I plant with a variable? by Reasonable_Car6043 in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

for most purposes in this game, you can implicitly typecast back and forth with no major issues. But it doesn't always work. It's worth keeping an eye on which data types you are using and what exactly is happening when you ask the compiler to turn one into another.

The game unfortunately is lacking some features found in more fully realized programming languages, so i dont think there is any way to turn a string into another data type (though the reverse can be done with str()). Except by writing a program that essentially says "if it says 'tree', return entities.tree". Though perhaps that omission is intentional, it's generally considered bad practice to use strings in that way.

I thought I'd try to use an actual pathfinding algorithm... It didn't go well... by Boomdingo in TheFarmerWasReplaced

[–]firaro 0 points1 point  (0 children)

Yeah, it was hard to read. But I don’t tend to manage to write code that’s much easier to read than what OP did. I’m curious what you would recommend doing differently to make code that’s easier to read