Using playdate SDK with the standalone lua interpreter

,

This is somewhat similar question to Stand alone Playdate extended Lua interpreter.

What is the best way to use the Playdate SDK with the standalone lua interpreter?

Concrete example, on my Mac, run: lua and be able to use playdate.geometry?

Having a REPL handy for working through maths/geometry would help speed things up vs always running/debugging through the simulator.

$ lua
Lua 5.4.7  Copyright (C) 1994-2024 Lua.org, PUC-Rio
> playdate.geometry.distanceToPoint(1,2,3,4)
stdin:1: attempt to index a nil value (global 'playdate')
stack traceback:
        stdin:1: in main chunk
        [C]: in ?
>

I've tried import/require from my CoreLibs directory without much luck. I can copy files from there but I actually don't see playdate.geometry.

I figure at this point I am just missing something obvious, any help appreciated.

There's no way to do this in standalone Lua but I think the Simulator's console window offers a pseudo-REPL for non-system Lua apps (execute only, just wrap the evals in a print call).
In addition, you can check the value of a global variable by looking at the Lua Memory window in the Simulator.

1 Like

Ah, totally missed the command prompt at the bottom of the simulator console. That works well enough for my needs, thank you!