!laJBzNwLcAOMAbAEeQ:matrix.org

k

732 Members
Discussion about the various k languages. For ngn/k dicussion, please see #ngnk:matrix.org15 Servers

Load older messages


SenderMessageTime
11 Oct 2024
@_discord_870115701279584326:t2bot.iodiscodoug CMC: Implement the [Klotski puzzle](https://en.wikipedia.org/wiki/Klotski). 05:50:08
@_discord_1140710589165994105:t2bot.ioktye_67449 if you don't have avx512 you can run it with intel's emulator. you need some flags like -mavx512f to compile it. look at the error message and add the flags one by one. 06:17:26
@_discord_768182477449592832:t2bot.iomiku.rb Good deal 06:33:00
@anaseto:matrix.organaseto
In reply to @_discord_385956474146258944:t2bot.io
it makes sense, thanks
Thinking about it, I finally made exp and log accept an optional base left argument, like J and BQN do. So exp can now be used for power. I originally just based math functions off AWK's, because of minimalism, but dyadic extension is actually nice in an array language (and power is probably used more often with bases other than e). It does also offer somewhat better precision in some edge-cases than the user-defined power function did.
08:36:11
@sjjssk:matrix.org@sjjssk:matrix.org joined the room.11:35:49
@sjjssk:matrix.org@sjjssk:matrix.org joined the room.11:57:56
@sjjssk:matrix.org@sjjssk:matrix.org left the room.11:58:29
@_discord_255527948503744513:t2bot.ioolabaz 15:48:40
12 Oct 2024
@_discord_870115701279584326:t2bot.iodiscodoug 43! 21:47:06
13 Oct 2024
@saucerr:matrix.org@saucerr:matrix.org joined the room.01:10:01
@saucerr:matrix.org@saucerr:matrix.orgRedacted or Malformed Event19:34:27
@mlochbaum:matrix.orgMarshall banned @saucerr:matrix.org@saucerr:matrix.org.19:35:18
@_discord_116306741058207744:t2bot.iovendethiel @Admin 19:36:57
@_discord_724421839924756480:t2bot.io_elcaro_ re: "quick turns", whenever I implement snake, the key-presses get appended to a list, and each tick the top move is popped off and processed (and is discarded if it is opposite to the current direction) that way no input gets dropped. 23:39:57
@_discord_724421839924756480:t2bot.io_elcaro_ My J Raylib snake is [here](https://github.com/0racle/j-raylib/blob/main/examples/snake.ijs). dbuf is the direction buffer (list). 23:43:49
@_discord_724421839924756480:t2bot.io_elcaro_ In my version, hitting the wall also == death, but converting this to a toroidal snake wouldn't be too hard 23:44:24
14 Oct 2024
@_discord_870115701279584326:t2bot.iodiscodoug Yeah, that's an option too, though I find when I play and it gets tight my fingers fumble a bit and so making up for that before the tick feels like it may be a plus. 00:28:14
@_discord_870115701279584326:t2bot.iodiscodoug In my version I used a circular buffer for the "worm" (not sure why I thought of it as a worm...) mostly because it felt like less shuffling of memory though it hardly matters. 00:31:11
@_discord_870115701279584326:t2bot.iodiscodoug _elcaro_ Is there a playable version of yours online? 00:33:52
@_discord_724421839924756480:t2bot.io_elcaro_ No, unfortunately not. 00:47:43
@_discord_724421839924756480:t2bot.io_elcaro_ The only web-playable snake I have was written using [p5.js](https://p5js.org/), but otherwise is implemented in a similar way... but it's on an old hdd that I can't access right now. 00:49:20
@_discord_870115701279584326:t2bot.iodiscodoug Rats. @ktye started working on some [raylib bindings for k](https://github.com/ktye/i/blob/master/%2B/ray/ray.c). I wonder what it would take to integrate some ffi bindings into the online WASM. 00:52:42
@_discord_870115701279584326:t2bot.iodiscodoug I actually kind of like the lofi aesthetic of the games in the the online section, but having better control over the graphics would be a whole new avenue to explore. My other idea was exposing underlying K arrays to the JS side so that you could use a K array as the canvas buffer rather than using canvas methods to draw. 00:57:30
@_discord_870115701279584326:t2bot.iodiscodoug I think this shouldn't be too hard. I poked around a bit but never polished it off. 00:57:56
@_discord_724421839924756480:t2bot.io_elcaro_ Yeah, I recall tangentstorm looked a little into getting raylib bindings working in the wasm J, but I don't think he got very far. 01:04:42
@_discord_724421839924756480:t2bot.io_elcaro_ Hrm, ok there was a version saved in the p5.js web editor. [Link](https://editor.p5js.org/0rac1e/full/SKwMBvfbU)

Obviously, JS is not an arrraylang... but this version plays almost identically to my J version.

Moves are pushed onto an array called keys, and the top one popped of and processed in the draw function.

You'll notice you can rapidly hammer - for example - Up Left Up Left Up Left Up Left... and the snake will zig-zag up the screen. Rapid U-turns are also easy to do
01:13:51
@_discord_870115701279584326:t2bot.iodiscodoug 53!! 08:09:31
15 Oct 2024
@_discord_326519812820041731:t2bot.iotortus_ changed their profile picture.04:44:04
@_discord_257233576263811072:t2bot.ioalveb changed their profile picture.10:04:41
@anaseto:matrix.organaseto I've improved run and open a bit for advanced usages: they now accept a dict as left argument too, which can be used to more finely configure the stdin, stdout, and stderr of the command, as well as environment and working directory. I summarized usage in a table in the FAQ. 17:00:39

There are no newer messages yet.


Back to Room ListRoom Version: 6