#codegolf

2025-05-16

rose quartz + DOF #glsl #generative #tinycode #codegolf
vec3 q=vec3(0,0,7e3),v=FC.rgb-r.xyx*.5,p,u=sin(FC.rgb*PI);v-=u*4.;for(float i,s;i++<67.;s=abs(2e3-length(p.yz))-3e1,q+=sin(i)+v*.7/r.x*s,o+=exp(-s*s/vec4(4,1,2,1))/i)for(p=q+u*4e4/r.x,s=7e3;9.<s;p=p.zxy+s*.02*sin(p/s*17.),s*=.8)p.zx*=rotate2D(s+(s==7e3?t*.2:0.));

2025-05-12

More #codegolf #programming - this time it's for some space invader animations. (140 characters was not enough to make the game interactive)

dwitter.net/d/33772

N-gated Hacker Newsngate
2025-05-10

✨ Behold the groundbreaking revelation: you can animate dots with simple math! 🤯 Code golfing has never been so exhilarating, or so... dotty. 🎯 Just when you thought life couldn't get simpler, here come the 16x16 dots to prove you wrong. 🎨✨
tixy.land

2025-05-08

So I watched this video youtube.com/watch?v=RcVA8Nj6HE

And I decided to check what "plus times plus" actually computes. Luckily, I have my own #LambdaCalculus compiling language, #Lamber f github.com/aartaka/lamber

So I ran "* + + 1 2 3" and got... 36. So a number from a #math operator applied to other operators and then to data. Which seems like a nice basis for math conspiracy theories. How many of the basic arithmetic functions can we combine, and to what result? Might even end up with lambda calculus #codegolf things, like this division function John Tromp listed with attribution to Bertram Felgenhauer:

def div fn (dividend divisor)
local F = fn (m f t)
m T' (fn (c) f : c t) id .
int (fn (f x)
(int dividend) T' (K x) ((int dividend) (F (int divisor) f) x)) .

Adapted to Lamber, of course. But not any more readable than it used to be. Which is a cool feature of LC—you can apply anything to anything and get something as a result, albeit with a really confusing program flow.

I'm that close to learning some logical language and trying to devise mine, with lambda diagrams as concept ideograms and function application as the only syntactic relation. Yeah I know I'm going crazy, but at least it's fun.

#theObservatory

2025-04-19
Lea Rosemalea@lea.lgbt
2025-03-25

JavaScript piano one-liner :) #codegolf

for(p='',y=5;y--;p+="\n")for(x=80;x--;)p+=x&1?5-y<4*((59&(1<<((x>>1)%7)))>0)|0?'#':'|':' ';console.log(p)

2025-03-19

Simplest way to draw HAKMEM 149 based structure without offsetting / adjusting the seeds, turns out that using one unsigned shift is the 🗝️

Loop is optional.

Two versions for the two different algorithm precisions. Adapted for 512x512.

Code is for a grey scale one but i made a colored one based on exponentially mapped iteration count (classic way to color fractals), this somehow require to offset coordinates for nice colors.

#fractal #codegolf #sizecoding #algorithm #computergraphics

Colored precise (not skewed) version of HAKMEM 149 based structure, colors are exponentially mapped based on iteration count.HAKMEM 149 structure code (precise; grey scale), adapted for 512x512 framebuffer (last two shifts), 32 bitsSkewed grey scale version of the HAKMEM 149 structure.Skewed HAKMEM 149 structure code. Adapted for a 512x513 framebuffer, 32 bits.
2025-03-15

I have succeeded in creating a polyphonic #WebAudio soundscape, with 140 characters.

So proud/not proud with the cheats needed to get this code down to size.

dwitter.net/d/33468

#codegolf #programming

Digital Mark λ ☕️ 🕹 🙄mdhughes@appdot.net
2025-03-09

Doing some table generation in awk, and is there an easier way to do "all fields n to NF" than this?

function combine(combn, combs) {
for (; combn<=NF; ++combn) {
combs=combs "\t" $(combn)
}
return combs
}

I could use printf on the fragments, but the annoyance is that loop, instead of
(string-join (cddr fields) "\t")
or whatever.

#awk #unix #codegolf

2025-03-04

More golf!

194 bytes of code, which compresses to 140.

I have significantly better looking versions, but I need an extra 9 bytes to do it!

dwitter.net/d/33440

#javascript #pixelshader #graphics #hacking #codegolf

2025-02-28

FWIW, that image shows the output of a real-time pixel shader, written in 171 bytes of #javascript

#graphics #pixels #codegolf

2025-02-09

This feels like a good game for #codegolf - writing compact solvers for it - brute force is OK but I'm also curious about better solutions

Zuri (he/him) 🕐 CETshaedrich@mastodon.online
2025-02-04

Another #CodeGolf puzzle for #JavaScript #WebDev people:

I have n functions that type one argument of the same type and return a boolean.

The current usage is:
function a(b) {
return c(b) && d(b)
}

I boiled down a to
a = (b) => [c, d].every(fn => fn(x))

I assume, this can be further boiled down via bind/ #PartialApplication/ #Currying

What do you think?

#amCoding #amProgramming #webDevelopment #softwareDevelopment #softwareEngineering

vintage screwlisp accountscrewtape@mastodon.sdf.org
2025-01-21

#lispygopherclimate archives.anonradio.net/2025012 #archive
#ClimateCrisis haiku/wildfires by @kentpitman

Electric (guitar) #music by @ksaj, community message from @TheGibson

Arrokoth #McClim Graphical adventure Game creation system #lisp
by five decade #gamedev veteran @mdhughes
#NUD #codegolf / adopting Arrokoth
@baruchel #lisp destructive permutation

#mastobook club - Snow crash

#livechat in #lambdaMOO
telnet lambda.moo.mud.org 8888
co guest
@join screwtape

@nosrednayduj @ratxue @hairylarry

LISPY GOPHER SHOW
anonradio.net 0UTC Wednesday
Two demons flank a gopher and the lisp alaien wading through wreckage, the fallen openai logo nearby.
vintage screwlisp accountscrewtape@mastodon.sdf.org
2025-01-21

#NUD #codegolf #programming #gamedev #commonlisp
If you'll forgive the daily throwaway challenges, here's another one. To quote from the link,:
```
'(a (b c) d (e f))

overwrite the b with the f.
```
My solution, featuring the new "apply nconc to register", &
```
(progn ^^ [ >> >> v [ & ^^ [ >> >> ] )
```
the ability to use & to create portals opens up a world of puzzles/golf challenges.

lispy-gopher-show.itch.io/lisp

I'll add @mdhughes' mdhughes.tech/software/arrokot for the interface this week.

** Challenge 2                                                    :screwlisp:
*** Input
#+begin_src lisp :exports code
  '(a (b c) d (e f))
#+end_src
overwrite the b with the f.
*** Screwtape's solution.
#+begin_src lisp :exports both :cache yes :results output verbatim
  (progn 
    (require :nud)
    (in-package :nud/user)
    (setq *test2* '(a (b c) d (e f)))
    (gird *test2*)
    (progn ^^ [ >> >> v [ & ^^ [ >> >> ] )
    (print *test2*))
#+end_src

#+RESULTS[2892b5078657512145cbba8e177e48f3b7dc43fd]:
: 
: (#1=(#:CURSOR F) D E (F B . #1#)) 

Well, if you'll believe me that F behind the cursor used to be that b.
2025-01-20

1D cellular automaton in 133 bytes of code!

dwitter.net/d/33092

this.r??=1;s=10;j=1;for(n=i=0;i<32;j*=2)(j&r)&&x.fillRect(i*s,t*600,s,s),n|=126&1<<((r&1<<++i?4:0)|(r&j?2:0)|(r&1<<i+30?1:0))?j:0;r=n

#programming #codegolf #life

vintage screwlisp accountscrewtape@mastodon.sdf.org
2025-01-20

#gameDev
#codeGolf is a #game right?? "Challenges" and all that. #programmingChallenge #programming
lispy-gopher-show.itch.io/lisp
I modified my little NUD language to basically be vi but for #lisp lists. Er, if I do say so. YMMV

Alternately, propose your own challenges for me and others to solve (I'll add them to the git here: codeberg.org/tfw/nud/src/branc )

If anyone wants help trying or has other commentary, lmk here or during the show.

NUD GOLF
An emacs org doc presenting a NUD program, a small structure-editor-like program written by screwlisp. The challenge is to fix the typo in
'(foo foo foo ofo bar bar bar bar)

Screwlisp's solution is
^^ ^^ >> [ >> ] (loop :repeat 8 :do (progn >>) :finally (return *test1*)

(*test1* being the smashed input).
2025-01-17

A tiny way to compute a square / triangle wave at the same time without conditionals, only basic arithmetic and shifts.

This can be used for #oscillators or animations etc. #algorithm is a variant of HAKMEM 149.

Can also be used to draw a square. (And other shapes, see previous toot)

Code also shows how to draw a diamond shape by rotating the square by 45°.

There are two versions, optimized for size and optimized for speed.

#computergraphics #p5js #softwarerendering #codegolf #sizecoding

Square wave and triangle waveform computed without conditionals, only basic arithmetic and shifts using HAKMEM 149 algorithm variants. Also show 2D shapes (square and diamond) drawn by combining the triangle and square value.p5js code of the algorithm optimized for size (has overdraw !)p5js code of the algorithm optimized for speed, the render code is moved outside the algorithm iteration loop, has much less overdraw except on the square wave code which is unchanged due to the sharp transition.
2025-01-16

I've finished and released the #interpreter for my new esoteric #programminglanguage , Bespoke!

github.com/WinslowJosiah/bespo

I've also been having lots of fun trying to solve #programming challenges with it, including #codegolf challenges.

#esolang #esolangs #code #coding

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst