Workshop
- buttondown.email Raku is surprisingly good for CLIs
A while back I wrote Raku: a Language for Gremlins about my first experiences with the language. After three more months of using it I've found that it's...
-
Dear Google Cloud: Your Deprecation Policy is Killing You
>Backwards compatibility comes with a steep cost, and Android has chosen to bear the burden of that cost, whereas Google insists that you, the paying customer, bear that burden.
-
Raku: The Programming Language You Didn't Know You Needed
YouTube Video
Click to view this content.
- posttext.pl Post previews are live
Better late than never amirite?? Also fixed some lil CSS things that were buggin me like the padding for ol/ul and blockquote elements. Forgot about the `robots.txt` it was 'out of date' so that's fixed. Procrastination achievement unlocked! -----BEGIN PGP MESSAGE----- ow…
-
wormkeeper (Pico-8 game)
The math behind the game is
atan2
which I use to get the angle from a thing to another thing:lua function ato(from,to) return atan2( to.x-from.x, to.y-from.y ) end
And then when you give that angle to
cos
for the x axis andsin
for the y axis you get (x,y) coords that can be multiplied by the number of pixels you want to "move" in that direction. So this function assumes a table like{x,y,a,s}
and returns new a new x,y multiplied bys
for "speed"...lua function amove(●,s) s=s or ●.s return ●.x+cos(●.a)*s, ●.y+sin(●.a)*s end
I use both those together like this to move the worms each frame. (This symbol: ∧ looks more like a worm in the Pico-8 font. If you didn't notice I like the emoji for variables 😋)
lua for ∧ in all(∧s) do ∧.a=ato(∧,웃) ∧.x,∧.y=amove(∧) end
The astitue reader may have noticed
amove
allows one to supply their owns
instead of the table'ss
... this is useful when you want to calculate things along something like a line, I mean the length of a worm. For example if we put everything together then we get this loop that, after a bullet (✽
) moves, checks every part of a worm (for ∧t=0,∧.l do
where∧.l
is worm length and∧t
is each "tail" pixel) and if they collided deletes both and plays a sound effect.amove
is given each∧t
but it's not actually used to move the worm, just to reconstruct it's body for collision detection.lua for ∧ in all(∧s) do for ∧t=0,∧.l do ∧x,∧y=amove(∧,∧t) if flr(✽.x)==flr(∧x) and flr(✽.y)==flr(∧y) then del(bullets,✽) del(∧s,∧) if #∧s==0 then sfx(2) else sfx(1) end end end end
-
Netflix Linux system troubleshooting reference article
A really nice summary of Linux troubleshooting triage that I've been using as a reference for years.
- posttext.pl New remark-to-remark feature (and some thoughts)
# New remark-to-remark feature Alright so I implemented the remark-to-remark feature. Thanks for the suggestion, it wasn't difficult to implement and makes copying a quote or referencing the previous remark easier. I also went ahead and moved 'last remark' above 'thread' in the 'post remark' for…
- blog.swagg.net Stupid Meta...
So there's these ` elements by Meta. Well not the ` element itself... But Open Graph. I wanted my links to look like this when I spam the...