okay you can run it now!

nix is nice still, i was doing something dumb
This commit is contained in:
mehbark 2023-12-24 13:43:16 -05:00
parent 9095800378
commit 86806ff5a0
5 changed files with 11 additions and 8 deletions

View file

@ -16,8 +16,9 @@
packages = forEachSupportedSystem ({ pkgs }: {
default = pkgs.writeShellScriptBin "mineschemer" ''
LD_LIBRARY_PATH="${pkgs.raylib}/lib" \
${pkgs.chez}/bin/scheme \
--script ${pkgs.writeText "main.scm" (builtins.readFile ./main.scm)} \
${pkgs.chez}/bin/scheme \
--script ${./main.scm} \
${./skins/classic.bmp} \
$@
'';
});

View file

@ -690,7 +690,7 @@
; draw-game-over as a separate thing would be nice
; the game shows -99 when (- num-mines num-flagged) is less than -99
(define (run-game mines width height seed)
(define (run-game mines width height seed skin-path)
(init-window (* width square-width) (* height square-width) "mineschemer")
(set-target-fps 60)
@ -698,7 +698,7 @@
(newline)
(random-seed seed)
(let ([skin (load-skin "xp-flowers.bmp")]
(let ([skin (load-texture skin-path)]
[game (new-game mines width height)])
;; (display skin)
;; (newline)
@ -734,10 +734,12 @@
(time-nanosecond (current-time)))
(unless (and
(>= 4 (length (command-line-arguments)) 3)
(for-all number? (map string->number (command-line-arguments))))
(pair? (command-line-arguments))
(>= 4 (length (cdr (command-line-arguments))) 3)
(for-all number? (map string->number (cdr (command-line-arguments)))))
(display "i need 3-4 numbers (MINES WIDTH HEIGHT SEED)")
(exit 1))
(apply run-game (append (map string->number (command-line-arguments))
(list (get-nano-seed))))
; i really need some actual arg parsing this is embarassing
(apply run-game (append (map string->number (cdr (command-line-arguments)))
(list (get-nano-seed) (car (command-line-arguments)))))

BIN
skins/classic.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
skins/xp-flowers.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB