hmm, guess i’ll have to mod C decker to do what I want then. Thanks for the info.
razetime
Recent community posts
I am running decker on bash in linux with ./c/build/decker, How do I print to stdout from that process?
I have tried
shell["/usr/bin/env bash -c \"echo asdas\""]
shell["echo asdas"]
shell["echo asdas > /dev/fd/1"]
which simply returns 0 and do nothing. I am not sure how it works.
print["adasda"] just prints inside the decker interface.
I am attempting to solve Advent of Code Day 21, specifically part 2 of the problem, which just asks for the same solution on the 18th iteration.
My problem is that both the grouping method used, and the method where I manually construct the grid index by index are both extremely slow. They start slowing down massively at around iteration 15, and they usually get terminated after iteration 17 is reached (oom, maybe?)
I’d like to know how to improve these functions. my code is at https://github.com/razetime/aoc/blob/main/17/21.lil.
Why does distinct not always return a list?
In the example for distinct elements given:
extract first value by value from "ABBAAC"
when all items are equal, this provides a single element instead of a single element list. I don’t know why, but in my head it seems more flexible to return a single element list.
This is what i ended up using instead, since select always returns a list.
There is another workaround here since selecting the first element of each group in () will give (0), the default value, but at least that makes sense.
on uniq x do
if x~() () else
t:select list first value by value from x
t.c0
end
end
After a lot of poking and prodding, I’ve made a simple flappy bird clone at https://github.com/razetime/decks/blob/main/flappybird.deck .
I was earlier trying to figure out how to calculate score, so I tried using pipe.pattern to store the flag for whether a pipe was already passed. It instead segfaulted Decker. I’ve tested the deck now a few times and it doesn’t segfault, but it might turn up after some playtesting. It’s otherwise been very fun figuring this out in decker.
for reference, the image string is
%%IMG2ACIAGCAuAQwgEgEEIAYBAiAEAQIgEAEEIAYBAiAEAQIgDgECIAgBAiAIAQIgDAECIAgBAiAIAQIgCgECIAoBAiAGAQIgAgECIAgBAiAKAQIgBgECIAIBAiAGAQIgDAECIAYBAiACAQIgBgECIAwBAiAGAQIgAgECIAYBCiAGAQIgCAECIAYBCiAGAQIgCAECIAQBAiAKAQIgBgEMIAIBAiAKAQIgBgEMIAIBAiAKAQIgBAECIAwBBCAKAQIgBAECIAwBAiACAQogBAECIAIBDCAEAQogBAECIAIBDCAGAQIgDAECIAoBAiAGAQIgDAECIAoBAiAIAQQgCgEKIAoBBCAKAQogDgEKIBgBCiAO
and this is a screenshot of what happens: 
Couldn't find the win condition. None of my keys were firing a splinter. I'm assuming killing all of them was supposed to win you the game.
It looks like theres a timer for movements so you're forced to move at the same pace as the other puppets. Makes the game feel spotty, try a different approach to that.
Presentation looks strange and spotty. Definitely can be improved. Good luck on your next try!
EDIT: Played this on the Mac version. Works without any modifications.