about summary refs log blame commit diff stats
path: root/README.md
blob: b756367cdf591878697cd99f9df557d307c1099a (plain) (tree)
ile. If you get stuck or have a question, [send it to me!](http://akkartik.name/contact) ## Task 3: variables and arithmetic Can you figure out how to modify this app to increment by 2 each time you hit `enter`? Again, don't be afraid to experiment. The menu at the bottom always shows the hotkeys available to you at any point in time. Don't worry, everything you do can be undone. Divide the problem into two parts in your head: where to make your change and what change to make there. You've already gotten some practice selecting a place to modify in Task 2. Repeat that process. Go back to the `render` page. What is the name of the _variable_ (box containing a number) that decides what number gets printed to screen? Go back to the big picture. Where is this variable defined? How does it get modified when you press `enter`? If you're stuck, some short sections from [the Lua book](https://www.lua.org/pil/contents.html) might help at this point: [getting started](https://www.lua.org/pil/1.html); [assignment](https://www.lua.org/pil/4.1.html); [what you can do with numbers](https://www.lua.org/pil/3.1.html). (Buy the Lua book to support the creators of Lua. Teliva is a tiny molehill on the mountain of awesome that is Lua.) Some hints: - The function responsible for processing keystrokes is `update`. - The variable that tracks what number to print on screen is `n`.