diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2007-09-08 14:07:03 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2007-09-08 14:07:03 -0500 |
commit | 3203f17f6549e8a239a7e12786c2857459ec7e29 (patch) | |
tree | 4daaf082eb9449a9f18b1c90e88ac408026572fa /test | |
parent | 306f4f9df61f1283ffdd0c5101c8ec30379fb554 (diff) | |
download | luancurses-3203f17f6549e8a239a7e12786c2857459ec7e29.tar.gz luancurses-3203f17f6549e8a239a7e12786c2857459ec7e29.zip |
update the test script with new changes
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lua | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/test.lua b/test/test.lua index c6c24f8..6588160 100644 --- a/test/test.lua +++ b/test/test.lua @@ -3,14 +3,10 @@ require "curses" curses.initscr(); curses.start_color(); curses.setup_term{nl = false, cbreak = true, echo = false, keypad = true} -curses.init_pair("black", "black") -curses.init_pair("green", "green") -curses.init_pair("red", "red") -curses.init_pair("cyan", "cyan") -curses.init_pair("white", "white") -curses.init_pair("magenta", "magenta") -curses.init_pair("blue", "blue") -curses.init_pair("yellow", "yellow") +local colors = {"black", "green", "red", "cyan", "white", "magenta", "blue", "yellow"} +for _, color in ipairs(colors) do + curses.init_pair(color, color) +end local x, y = 0, 0 local maxy, maxx = curses.getmaxyx() @@ -25,7 +21,7 @@ while true do elseif c == "down" and y < maxy - 1 then y = y + 1 elseif #c == 1 then - curses.addstr(c) + curses.addch(c, {color = colors[math.random(#colors)]}) end curses.move(y, x) end |