What is Nostr?
Gene Pasquet /
npub1n60…qgrs
2024-05-22 09:09:25

Gene Pasquet on Nostr: Is there a better way to write this in scheme? That looks ugly to me: (define ...

Is there a better way to write this in scheme? That looks ugly to me:

(define (player-collides?)
(let ((player-hitbox (vehicle-hitbox player-position)))
(let loop ((vehicles vehicles))
(if (rect-intersects? player-hitbox (vehicle-hitbox (vehicle-position (car vehicles))))
#t
(if (null? (cdr vehicles))
#f
(loop (cdr vehicles)))))))


#lisp #scheme #lispgamejam
Author Public Key
npub1n60cfz2j6ht4wl3x8x66rq03t5sl26p96xjx0a0sndhcw36lm92slcqgrs