Thanks for the info. Is there a way to get the string that show[]
prints to the listener, for example? That way I can get a clickable string, and copy it over.
razetime
Creator of
Recent community posts
I can see that me
and selected
can be used in the listener to copy data from the listener to the deck, but I am wondering how to just copy listener text to clipboard. I was thinking of creating a field and copying the data over to its text field, but I’m not sure how to get the lil representation of a value as a string without a little more complicated queries.
I also want to know if there is a way to reuse previous lines in the listener without having to scroll to them and clicking on them.
Although decks are pretty versatile and can serve as full webpages themselves, I found myself wanting to link decks from a homepage deck. The result is at https://razetime.github.io/decks/ , and the lil based code is at https://github.com/razetime/decks/blob/main/gen.lil .
I wrote a small writeup about it on my blog for people who don’t know decker or lil too well.
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.