diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-10 16:39:33 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-10 16:39:33 -0800 |
commit | 0344a4c9a1317462500a6569eaf48f04f5b3136e (patch) | |
tree | 2159bc877bea56e883ec91a5b5349c7cadc33642 | |
parent | d5e2d7a0fd041bbd80f9b63ec43c0a3687446c7b (diff) | |
download | teliva-0344a4c9a1317462500a6569eaf48f04f5b3136e.tar.gz |
extract side-effect from 'update'
-rw-r--r-- | life.teliva | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/life.teliva b/life.teliva index b953341..9a1ff23 100644 --- a/life.teliva +++ b/life.teliva @@ -180,8 +180,8 @@ end -- process input menu = {arrow="pan"} -function update(window) - c = curses.getch() + +function update(window, c) if c == curses.KEY_LEFT then for i=1,lines*4 do for j=2,cols*2 do @@ -284,7 +284,8 @@ function main() -- main loop while true do render(window) - update(window) + c = curses.getch() + update(window, c) step() end end |