--- Game of Life Simulation --- Andy Kemp --- Still quite messy!! Needs to be optimised a bit, and currently only sized for handheld view... --[[ john Hanna's 4/22/11 changes: changed matrix to go from 0 to 19 in stead of 1 to 20. Makes Toral mode easier to compute! toral mode is on: see the one-line count neighbors calculation :) tweaked menu 'step' to change the pause button to a play button but clicking the step button (image) does not change the pause button to a play button as I think it should. I added a pausetoplay() function. added a generation counter added a stop when two consecutive generations are the same. this does not account for 'blinkers'. ]] --images-- play = image.new("-\000\000\000-\000\000\000\000\000\000\000Z\000\000\000\016\000\001\000\254\255\255\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\253\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\251\255\255\254\251\255\255\181\214\132\144\016\194\240\189\240\189\239\189\239\189\239\189\239\189\015\190\015\190\238\193\238\193\239\193\239\193\240\189\016\190\016\190\016\190\016\190\015\190\015\190\015\190\015\194\240\193\240\193\240\193\016\194\239\189\016\194\016\194\016\194\140\177\198\152\181\214\255\255\222\251\255\255\255\255\255\255\254\255\255\255\221\251\255\255\156\243\132\144\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128!\132\000\128B\136\156\243\255\255\255\255\255\255\255\255\254\255\254\255\255\255\156\243\164\148\000\128\132\144\206\185\016\194\016\194\016\194\016\194\015\194\015\194\015\194\015\194\017\194\017\194\017\194\017\194\017\194\016\194\016\194\015\194\015\194\015\194\015\194\015\194\015\194\016\194\016\194\016\194\239\189\206\185R\202\239\189\206\185\239\189B\136\000\128\165\148{\239\255\255\222\251\255\255\255\255\255\255\188\247\198\152!\132\132\144\189\247\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\189\247\255\255\189\247\165\148\000\128\165\148\255\255\255\255\255\255\254\255\147\210\131\144\000\128\132\144\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\255\255\255\255\255\255\255\255\222\251\222\251\132\144!\132!\132\148\210\255\255\255\255\132\144\000\128c\140\189\247\255\255\255\255\223\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\253\251\253\247\253\247\253\251\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\189\247B\136\000\128\231\156\255\255\255\255\238\189\000\128\206\185\255\255\223\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\214\235\182\231\182\231\216\239\251\251\253\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\255\255\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\239\189\000\128\206\185\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\012\203\169\194\170\194\015\211\182\239\252\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\254\251\254\255\253\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\230\194B\174e\182\234\198O\215\215\239\252\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\253\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255z\239\227\190`\174\229\194)\203\200\194\014\211\215\239\253\255\255\251\255\255\255\255\255\255\255\255\255\255\254\255\253\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255z\239\003\191\193\182F\203h\211\197\194\200\194O\215\215\235\252\247\255\251\255\255\255\251\255\251\255\255\254\255\253\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255z\239\227\186\161\182\003\195F\203&\203\006\195\200\194\013\207\247\239\252\247\254\251\255\255\255\251\255\255\255\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255z\239\195\182\162\182\003\191E\203f\207$\199\195\186\198\190o\219\213\231\251\247\254\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255z\239\197\186\163\182%\195e\203c\199B\195\002\191\228\190\231\194.\211\182\235\252\247\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255z\239\231\190b\174\227\186D\199!\195b\199c\199\003\191\130\178\201\194Q\219\217\239\253\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\201\186\132\174\228\186\034\199 \199@\199 \195!\195\003\187\228\182\198\182,\203\214\231\253\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\201\186\132\174\195\186\034\195 \195 \195 \195!\191\003\187\228\186\197\182\233\190P\215\183\235\252\247\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\231\186\131\174\194\186\034\195\000\191\000\195\000\191!\191\002\187\003\187\195\182\164\182\200\194\014\211\182\235\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\230\186\130\174\193\182\001\191\000\191\000\191\000\187\001\187\002\187\034\187\226\182\193\182\163\182\199\194N\215\213\239\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\229\186\128\174\193\182\001\191\224\186\000\187\001\187\001\187\001\183!\187 \187\000\187\193\186\163\186\199\194,\211\156\243\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\228\186\128\174\193\182\001\191\000\187\001\187\001\187\001\187\000\183 \187 \187 \191\000\191\160\182\131\182\166\190{\239\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\227\186\128\174\193\182\001\191\000\187\000\187\001\187!\187 \183 \183 \187 \187\000\191\161\182\131\186\199\194{\239\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\228\186\128\174\193\182\001\191\000\187 \187 \187 \187 \183 \183\000\187\000\187\001\191\195\186\199\190\012\203\156\243\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\229\190\129\174\193\182\000\187\000\183@\187 \187 \187 \187 \187\000\187\224\182\161\182\199\190o\215\247\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\197\186\129\174\225\182!\187 \183@\187 \183 \183 \187\000\187\224\186\195\186\199\194-\207\182\231\253\247\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\198\186\130\174\226\182A\187@\183@\183 \183 \187C\195\193\186\130\182\199\194O\215\215\235\253\247\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\231\190\130\174\225\182@\187@\187`\187@\187B\191\227\186\164\186\167\190\014\211\214\235\253\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\231\190\130\174\225\178@\187`\187`\187 \187\003\187\131\178\201\198Q\219\183\239\251\251\254\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\198\186\129\174\001\183a\191`\187@\183\000\179\196\182\200\1900\215\216\239\253\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\198\186\129\174\001\183`\191`\187@\183\001\183\230\186\145\219\183\231\252\251\255\255\255\255\255\255\255\255\223\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255z\239\229\186\161\174\000\183`\187@\183 \179#\187*\199\246\235\252\247\255\255\255\255\223\255\223\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\016\194\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255{\239 \183\192\170\003\187'\195\166\182\170\190s\223\184\235\254\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\016\194\000\128\016\194\255\255\255\255\239\189\000\128\239\189\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255{\239\002\183\160\170\228\182\008\195\233\194\014\207\215\235\252\251\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\206\185\000\128\206\185\255\255\255\255\016\194\000\128R\202\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255{\239\229\186b\170C\174\201\194P\215\214\235\251\251\253\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\2511\198\000\128R\202\222\251\255\255\239\189\000\128\206\185\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\156\243\012\203\202\194\138\190\015\211\215\239\252\251\253\255\253\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\206\185\000\128\206\185\255\255\255\255\016\194\000\128\239\189\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\182\235\183\235\183\235\217\239\252\251\253\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\016\194\000\128R\202\255\255\255\255\140\177\000\128\239\189\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\253\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\173\181\000\128\173\181\255\255\255\255\231\156\000\128B\136\189\247\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251{\239\000\128\000\128!\132\255\255\255\255\214\218\132\144\000\128\198\152\189\247\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\156\243\000\128!\132\000\128\148\210\255\255\255\255\255\255\189\247\198\152\000\128\132\144\189\247\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255Z\235\000\128!\132\000\128{\239\255\255\222\251\255\255\222\251\255\255{\239\165\148!\132B\136\206\185\016\194\016\194\016\194\016\194\016\194\016\194\016\194\016\194\240\193\240\193\240\193\240\193\240\193\239\193\239\193\015\194\015\194\015\194\015\190\016\190\016\190\016\190\016\190\016\1901\198\206\185\016\194\173\1811\198\173\181\000\128!\132\000\128{\239\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255!\132\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128B\136\000\128\000\128\000\128\000\1289\231\255\255\189\247\255\255\222\251\255\255\255\255\255\255\255\255\255\255\181\214\165\148\173\181\016\194\016\194\016\194\016\194\016\194\016\194\016\194\016\194\015\194\015\194\015\194\015\194\015\194\015\194\015\194\015\194\016\190\016\190\016\190\016\190\016\190\016\190\016\190\016\190R\202\239\189\239\189\206\1851\198\206\185!\132\181\214\255\255\255\255\255\255\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\255\255\189\247\255\255\255\255\222\251\255\255") pause = image.new("-\000\000\000-\000\000\000\000\000\000\000Z\000\000\000\016\000\001\000\255\255\255\255\222\255\255\255\255\255\254\255\255\255\255\255\255\251\255\251\255\251\255\251\255\251\255\255\255\255\255\255\221\255\254\255\255\255\255\255\255\255\223\255\223\255\255\255\255\255\255\255\255\255\222\255\222\255\223\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\255\255\255\222\255\255\255\180\214\131\144\016\194\016\190\017\190\017\190\017\190\240\189\240\189\239\193\239\193\238\197\238\193\015\186\016\186\017\190\242\193\242\197\241\193\240\189\015\190\014\190\238\197\206\197\239\197\239\193\016\190\239\189\239\189\016\194\239\189\015\190\140\173\231\152\214\214\255\255\222\251\255\255\255\255\255\255\255\255\255\255\222\251\255\255\155\243\132\148\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132\000\128\000\128 \128\000\128\001\128\000\128\000\128\000\128 \128 \128\000\128\000\132\000\132\000\128\000\128!\128\000\128\000\128\000\128\000\128!\132\000\128c\140\188\243\255\255\255\255\255\255\255\255\255\251\255\251\255\255\156\243\164\148\000\128c\144\205\185\015\194\239\193\239\193\239\193\015\194\015\198\238\197\238\193\014\194\014\190/\186/\186\016\186\016\194\240\193\239\189\014\186\014\186\014\186\014\190\238\193\238\193\015\190\015\182\239\185\173\181R\198\239\189\239\189\239\189B\136\000\128\165\148{\239\255\255\222\251\255\255\255\255\255\255\189\243\198\152!\132\131\144\188\251\255\255\255\255\254\255\254\255\254\255\254\255\254\255\253\255\221\255\254\255\254\255\255\251\255\251\255\255\255\255\255\255\255\255\255\255\254\251\254\255\254\255\254\255\255\255\255\255\255\251\255\255\255\255\255\255\255\255\222\247\255\255\189\243\165\144\000\128\165\148\255\255\255\255\255\255\255\251\148\206\132\140\000\128\132\144\222\255\255\255\254\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\255\223\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\251\255\255\254\251\255\251\255\255\255\255\255\251\222\251\222\251\132\144!\132!\132\148\210\255\255\255\255\133\144\000\128d\140\189\247\255\255\255\255\221\255\254\255\255\255\255\255\255\255\255\251\255\247\255\247\255\247\255\251\255\251\255\247\255\251\255\255\223\255\223\255\223\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\251\255\255\255\255\255\255\255\255\255\255\254\251\255\255\254\251\189\247B\136\000\128\231\156\255\255\255\255\239\189\000\128\206\185\255\255\222\255\255\255\255\255\255\255\255\255\255\255\255\247\190\235\157\227\158\223\159\219\159\223~\219\157\223\190\231\223\247\255\255\255\255\255\255\157\231\157\223\158\219~\223~\227~\227\158\223\158\223\222\251\222\251\255\255\222\247\255\255\255\255\255\255\255\255\255\255\239\189\000\128\206\185\255\255\255\255\239\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\255\255\251\157\231\216\194U\174V\170w\166W\166w\166u\170\215\190\189\227\255\251\255\251\158\231\183\190T\166v\166V\166V\170V\174V\170\249\182{\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\193\000\128\016\194\255\255\255\255\255\255\255\255\223\251\255\251\255\247}\223\184\1865\158\021\150\245\141\213\137\212\137\242\141u\166|\215\255\247\255\243\191\227\183\1744\1505\146\021\142\212\141\211\141\210\137v\154{\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\193\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\251\255\247\223\227\028\195\154\170z\1549\142\247\133\245\129\243\137v\166}\215\255\247\255\247\223\231<\191\185\162\186\154Y\146\246\137\212\137\212\133x\154{\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\193\000\128\016\194\255\255\255\255\255\255\255\255\255\255\255\251\255\247\255\231\127\203\029\179\221\158|\146\026\138\247\133\212\137v\170}\219\255\251\255\251\223\231\127\207\029\175\254\166\155\154\024\146\246\141\245\137\154\158z\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\193\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\247\223\231\127\203\030\179\189\158{\142\026\138\215\133\180\137U\170]\223\255\255\255\255\191\235^\207\253\174\254\166|\154\248\141\182\137\212\137y\158z\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\017\190\255\255\255\255\255\255\255\255\255\255\255\255\255\251\223\235~\207\029\179\220\158{\142\027\138\247\133\212\137V\174|\227\255\255\255\255\223\239]\207\028\175\254\166\156\154\024\142\214\137\213\137y\158Z\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\240\189\000\128\017\190\255\255\255\255\255\255\255\255\254\255\254\255\255\251\222\235]\207\252\178\187\158z\142\026\134\247\129\211\133u\170{\223\255\255\255\255\222\235}\203\028\171\030\163\155\150\024\138\246\133\244\133\152\154Z\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\240\189\001\128\017\190\255\251\255\255\255\255\254\255\254\255\254\255\255\255\223\239}\207\027\183\187\162z\146:\130\246\129\243\133u\166\155\219\255\251\255\251\255\235\157\203<\171\029\159\155\142\024\134\245\129\244\129\152\150Z\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\235~\203\029\175\220\158z\146\025\134\248\129\245\129w\166{\227\255\255\255\255\223\235~\199\028\175\251\166\154\154\025\138\215\129\245\137w\158[\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\239\189\000\128\016\194\255\255\255\255\241\193\001\128\016\194\254\255\254\255\254\255\254\255\255\255\255\255\255\247\255\227\127\199\028\171\218\150\185\134;\130\247\129\244\137v\170\092\219\255\247\255\247\223\227\159\203\030\171\031\163\156\1429\130\022\130\212\129x\154{\239\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\016\194\000\128\016\194\255\255\255\255\208\189\000\128\238\185\255\255\254\255\254\255\254\255\255\255\255\255\255\251\223\227<\195\185\166\153\150\152\1389\130\214\129\211\141U\174|\223\255\251\255\247\191\227<\195\186\166\187\154z\1427\134\245\133\211\137\152\162Z\235\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\206\185\000\128\206\185\255\255\255\255\017\198\000\128R\202\254\251\254\255\254\255\254\255\255\255\255\255\255\251~\227\184\186\020\154\020\142\020\138\246\137\180\133\178\145U\178|\227\255\251\255\251\190\231\151\182\020\154\021\146\022\142\245\137\179\137\178\141w\1669\231\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\2511\198\000\128R\202\222\251\255\255\239\189\000\128\238\181\255\255\254\255\255\255\222\255\255\255\255\255\255\255~\235\185\198U\174V\166v\162x\166V\166U\178\216\202\157\235\255\255\255\251\190\239\183\198U\174V\170w\166W\166V\170V\174\217\190{\239\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\206\185\000\128\206\185\255\255\255\255\016\194 \128\239\185\254\247\255\255\255\255\254\255\255\255\255\255\255\255\223\251\158\235~\223\159\223\159\219\159\219~\219}\223\158\235\223\251\255\255\255\255\223\247\157\235}\223\158\219~\219~\219\158\223\158\223\191\231\222\251\255\255\255\255\255\255\255\255\222\251\255\255\255\255\222\251\016\194\000\128R\202\255\255\255\255\140\177\000\128\239\185\255\255\255\255\222\251\255\255\255\255\223\255\223\255\255\255\255\255\255\255\255\251\255\247\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\247\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\173\181\000\128\173\181\255\255\255\255\231\156\000\128A\132\188\243\222\247\255\255\255\255\255\255\223\255\255\255\255\255\223\255\255\255\255\255\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251{\239\000\128\000\128!\132\255\255\255\255\181\218\131\144\000\128\230\152\189\247\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\253\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255{\239\000\128!\132\000\128\148\210\255\255\255\255\255\255\188\247\198\152\000\128\133\144\190\247\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255\253\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\253\255\253\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255Z\235\000\128!\132\000\128{\239\255\255\222\251\255\255\189\255\255\255[\239\165\148!\132B\132\206\181\016\190\016\190\015\194\015\194\015\194\014\190\014\190\014\190\237\197\238\197\239\193\016\194\017\190\017\190\017\190\016\190\015\190\014\194\014\194\014\194\238\193\238\193\239\193\240\1931\198\206\185\016\194\173\1811\198\173\181\000\128!\132\000\128{\239\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\255\034\132\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\001\128\001\128\001\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128B\136\000\128\000\128\000\128\000\1289\231\255\255\189\247\255\255\222\251\255\255\255\255\255\255\255\255\223\255\181\214\166\148\173\181\016\190\016\190\016\190\015\190\015\190\015\190\015\190\015\190\015\194\015\194\016\194\016\194\016\190\016\190\016\190\016\190\016\190\015\190\015\190\015\190\015\194\016\194\016\194\016\194R\202\239\189\239\189\206\1851\198\206\185!\132\181\214\255\255\255\255\255\255\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\255\255\189\247\255\255\255\255\222\251\255\255") reset = image.new("-\000\000\000-\000\000\000\000\000\000\000Z\000\000\000\016\000\001\000\255\255\255\255\254\251\255\255\255\255\255\255\255\255\223\255\255\255\255\255\255\251\255\247\255\247\255\251\255\255\255\255\255\255\255\255\255\255\255\255\254\255\255\255\255\255\223\255\255\255\255\255\255\255\254\251\254\255\255\255\255\255\255\255\255\255\222\255\255\255\255\255\223\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\255\255\222\255\255\255\254\251\255\255\181\214d\148\240\197\240\197\016\1941\1900\190\016\186\016\190\240\193\208\197\242\189\241\189\239\185\238\189\014\190\015\194\016\194\017\194\241\193\017\190\016\190\015\190\014\190\015\194\240\193\240\197\239\197\206\193\016\194\240\193\017\190\141\173\199\148\182\210\255\255\221\251\254\255\254\255\255\255\255\255\255\255\222\247\255\251\156\239\132\144\000\128\000\132\000\132\000\128\000\128\000\128\000\128\000\128\000\132\000\136\002\128\001\128\000\128\000\128\000\128\000\128\000\128\001\128\001\128\001\128\000\128\000\128\000\128\000\128\000\128\001\128\000\132\000\132\000\128\000\128\001\128\034\132\000\128B\132\157\243\255\255\255\255\255\255\255\255\255\255\255\251\255\255\189\239\165\144\000\128c\148\173\189\239\197\015\194\015\190\015\190\015\190\015\194\015\202\240\205\017\194\017\194\015\194\014\194\014\198\014\194\240\193\241\193\018\190\017\190\016\190\016\190\015\190\016\194\016\194\241\193\206\189\173\185R\206\239\189\207\185\239\185c\136\000\128\165\148{\239\255\255\222\255\255\255\255\255\255\255\190\243\199\148A\128\132\144\156\251\255\255\255\255\255\255\254\255\254\251\254\251\254\255\254\255\222\255\255\255\255\255\254\255\253\255\253\255\254\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\189\247\255\255\189\247\165\148\000\128\164\148\255\255\255\255\255\255\255\255\149\206\132\140\000\128\164\140\222\251\255\255\222\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\251\255\255\254\255\253\255\253\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\251\255\255\255\255\255\255\255\255\222\251\221\251\132\148 \132!\132\148\210\255\255\255\255\133\144\000\128\132\136\189\243\255\255\255\255\222\255\255\255\255\255\255\247\255\243\255\243\255\247\255\251\255\251\255\243\255\247\255\255\254\255\253\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\255\255\221\255\188\247B\136\000\128\231\156\255\255\255\255\239\189\000\128\206\181\255\255\222\255\223\255\255\255\255\255\255\247\190\231\157\219\157\215\157\219\158\223\159\227\158\223\190\231\254\243\255\255\254\255\255\255\255\255\255\251\255\255\255\255\255\255\254\255\254\255\254\255\255\255\255\255\255\251\255\247\255\255\222\251\255\255\254\255\254\255\255\255\255\255\206\189\000\128\206\185\255\251\255\255\239\189\000\128\016\190\255\255\255\255\255\255\255\255\255\255\191\235\215\194T\166v\170v\166V\1666\170U\170\183\190\190\231\255\255\254\255\255\255\255\255\255\251\255\251\255\255\255\255\254\255\254\255\254\255\255\255\255\255\255\247\255\247\255\251\255\255\254\255\254\255\253\255\254\255\255\255\239\193\000\128\016\194\255\255\255\255\239\193\000\128\015\190\255\255\255\255\255\255\255\255\255\247\158\223U\174\241\1455\1506\150\245\145\213\145\242\149U\170\157\223\255\251\255\255\255\255\255\255\255\251\255\251\255\255\255\255\254\255\254\255\255\255\255\251\255\247\190\227\157\227\255\243\255\251\255\255\254\255\254\255\254\255\255\255\239\193\000\128\017\190\255\255\255\255\239\193\000\128\015\190\255\255\255\255\255\255\255\255\255\251\158\223U\170\019\146\153\158\187\158Y\150\024\142\211\141V\166~\219\255\251\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\243\222\227\216\190\216\198\190\231\255\251\254\255\254\255\254\255\254\255\255\255\240\189\000\128\017\190\255\255\255\255\239\193\000\128\015\190\255\255\255\255\255\255\255\255\255\251\158\219v\166U\150\252\166\031\167\188\154:\142\021\142w\166\159\219\255\251\255\255\255\255\255\255\255\255\255\251\255\255\255\255\255\255\255\255\255\243\158\219;\1993\166u\178\157\223\255\247\254\251\254\255\254\255\222\255\255\255\240\189\000\128\017\190\255\255\255\255\239\189\000\128\015\190\255\255\255\255\255\255\255\255\255\251\158\219u\166U\146\252\162\030\163\156\150\024\134\021\138w\162~\215\255\251\255\255\255\255\255\255\255\255\255\251\255\255\255\255\255\255\255\247\159\223\250\186V\158\243\153U\170\158\219\255\247\255\251\254\255\254\255\254\255\255\255\240\189\001\128\017\190\255\255\255\255\240\189\000\128\016\190\255\255\255\255\255\255\255\255\255\251\158\223u\1665\150\251\162\030\163\187\1509\142\020\138w\162\158\219\255\255\255\255\254\255\254\255\255\255\255\251\255\255\255\255\223\251\159\231\028\195W\154\212\129\211\145V\166\158\215\255\243\255\251\254\255\254\255\254\255\255\255\240\189\001\128\017\190\255\255\255\255\240\189\000\128\016\190\255\255\255\255\255\255\255\255\255\251}\223T\1664\150\250\162\029\167\187\154Y\142\020\138w\166\158\223\255\255\254\255\253\255\254\255\255\255\255\251\255\251\255\251~\231\218\202X\166\022\138\246\129\210\141v\166\158\215\255\243\255\251\254\255\253\255\254\255\255\255\240\189\001\128\017\190\255\255\255\255\240\189\000\128\016\190\255\255\255\255\255\255\255\255\255\251\157\223t\170T\154\251\166\029\167\154\1547\142\244\137v\166}\219\255\255\222\255\253\255\254\255\255\255\255\251\255\251\191\239\218\210\021\174\212\141\246\1299\130\211\137w\166\159\215\255\243\255\251\255\255\253\255\255\255\255\255\240\189\001\128\017\190\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\185\145Z\170]\219\255\255\253\255\220\255\255\255\223\255\255\255~\231\218\186X\1509\130:\130\025\130\248\129\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\216\141Z\170}\223\255\255\253\255\254\255\255\255\223\251\158\235\250\206W\170\022\142\023\130\024\130\025\130\025\130\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\214\137y\170}\223\254\255\254\255\255\255\255\247\191\227\184\194v\1746\1588\1469\134\024\130\247\129\247\129\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\245\129w\166|\223\255\255\254\255\255\247\158\223<\195v\162V\158W\154z\150[\142\025\134\215\129\213\129\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\020\130v\162{\223\255\255\255\255\158\231\217\186\152\162\185\158\186\158\154\154Z\146\025\138\025\138\247\137\214\133\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\1344\130u\162\155\223\255\255\255\255\092\223V\1665\142\252\158\028\159\220\154z\142\025\138\025\138\248\137\214\137\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\1344\130\149\162\156\223\254\255\255\255}\227w\1706\146\219\154\251\154\220\150\155\142:\138\025\134\216\137\182\133\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\020\134\150\166\157\227\255\255\255\255\191\239\185\186w\166\217\162\217\154\185\146\154\138Z\134\025\130\216\133\216\137\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\245\137w\166}\223\255\255\255\255\223\251\159\227]\207v\166u\154v\142\153\138z\130\025\130\217\129\217\137\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\246\141x\170~\223\255\255\255\255\255\255\223\247\159\231\183\190\149\174u\150v\138X\130\025\130\218\133\218\141\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\215\141X\170~\223\255\251\255\255\255\255\255\255\223\251\157\235\248\202s\1624\1387\130\025\130\249\133\185\133\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\215\145X\170}\223\255\251\254\255\255\255\255\255\255\255\255\255\156\231\214\190U\1586\138\023\134\216\133\184\133\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\246\141X\170}\223\255\255\255\255\255\255\255\255\255\255\255\255\222\251\157\231\026\195V\158\213\133\214\133\248\141\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\245\137w\166}\223\255\255\255\255\255\255\255\255\255\255\222\255\255\255\255\255\191\231\251\1947\158\213\141\213\137\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\244\137u\166|\223\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\223\251\159\231\029\195W\162\211\137\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\240\189\000\128\016\194\255\255\255\255\255\255\255\255\255\255~\227u\162T\142\251\166\254\174\155\158Y\134\020\138u\166|\223\255\255\255\255\255\255\255\247\255\247\255\255\254\255\223\255\255\255\255\247\191\219\251\182v\154\213\133w\166\157\223\255\255\254\255\255\255\255\255\255\255\255\255\238\193\000\128\016\194\255\255\255\255\241\193\001\132\017\198\255\255\255\255\255\255\255\251\255\247}\215v\1705\154\252\166\031\163\188\142Z\130\210\145V\170\127\215\255\247\255\255\223\255\255\255\222\255\254\255\254\255\254\251\254\251\255\251\255\247}\239\026\227\019\182\019\182}\227\255\251\255\251\255\255\255\255\255\255\255\255\015\194\000\128\016\198\255\255\255\255\240\189\000\128\207\189\255\255\255\255\255\255\255\251\255\247}\219u\174\019\150\153\158\220\158z\142Y\134\209\145V\170\127\219\255\247\255\255\223\255\255\255\222\255\254\255\254\255\254\255\255\251\255\251\255\251\223\247}\239\184\202\183\202\158\231\255\251\255\247\255\255\255\255\255\255\255\255\205\185\000\132\206\189\255\255\255\255\017\194\000\128R\206\255\255\255\255\255\255\255\255\255\251|\223T\178\209\153\020\1546\150\245\137\245\133\209\149U\174~\219\255\251\255\255\223\255\255\255\254\255\254\255\254\255\254\251\255\251\255\251\255\255\255\255\223\251\158\235}\231\223\243\255\251\255\251\255\255\255\255\255\255\222\2550\198\000\128R\202\222\251\255\255\238\189\000\128\206\185\255\255\255\255\255\255\255\251\255\251\157\231\183\198T\178U\174v\170V\166W\166u\178\216\194\158\227\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\255\255\255\255\255\255\247\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\206\185\000\128\206\189\255\255\255\255\016\194 \128\238\189\221\251\255\255\255\255\255\255\255\255\255\247\157\235|\227}\223\158\223~\219\159\219\157\219\190\227\255\243\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\255\255\255\255\255\255\251\255\251\255\255\255\251\255\255\255\255\255\255\255\255\222\255\015\194\000\128Q\202\255\255\254\255\138\173\000\128\238\189\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\251\255\247\255\247\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\251\255\255\255\255\255\251\255\255\255\255\255\255\255\255\255\255\172\181\000\128\172\181\255\255\254\255\230\156\000\128A\132\188\247\221\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\221\251Z\239\000\128\000\132!\136\255\255\254\255\213\218\131\144\000\128\198\152\189\247\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255\254\255\254\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255z\239\000\128 \132\000\128\148\210\255\255\255\255\255\255\188\247\198\152\000\128\133\144\190\247\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255\253\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\255\255\255\255\255\255\254\255\255\255\254\255Z\239\000\132\000\132\000\128{\239\255\255\222\251\255\255\190\251\255\255[\239\165\148\034\132C\136\207\181\016\190\016\190\016\190\015\194\014\194\014\194\014\194\014\194\014\194\014\194\239\193\239\193\240\193\240\193\240\193\240\189\016\190\016\190\016\190\016\190\015\194\239\193\239\193\239\1930\198\206\189\015\194\173\181\016\198\173\185\000\128!\136\000\128{\239\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\255\034\132\001\128\034\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\132B\136\000\128\000\128\000\128\000\1289\231\255\255\189\247\255\255\222\251\255\255\255\255\255\255\255\255\223\255\182\214\166\148\174\181\016\190\016\190\016\190\016\190\015\190\015\190\015\190\015\190\015\198\015\194\015\194\016\194\016\194\016\194\016\194\016\194\016\194\016\194\016\194\016\194\016\194\016\194\015\194\015\194Q\202\238\189\239\189\206\1851\198\205\185!\132\181\214\255\255\255\255\255\255\255\255\255\255\222\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\251\255\255\189\247\255\255\255\255\222\251\255\255") step = image.new("-\000\000\000-\000\000\000\000\000\000\000Z\000\000\000\016\000\001\000\255\255\222\255\255\255\255\255\189\247\255\255\221\251\255\255\255\255\255\255\255\251\254\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\223\255\255\255\255\255\255\251\255\251\255\255\255\255\255\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\255\251\255\255\255\251\255\255\255\255\255\255\255\255\255\255\254\251\255\255\221\243\255\255\222\251\255\255\255\255\255\255R\206 \132k\173\239\185\140\173\141\177\140\181\238\193\205\185\173\181\206\185\205\181\173\181\174\185\174\185\174\185\174\181\174\181\206\181\206\181\173\181\173\185\173\185\205\185\205\181\205\181\205\181\173\185\173\181\206\181\206\181\206\181k\173d\144t\210\223\255\255\255\255\255\255\255\255\255\222\251\255\255\157\243\255\255\246\222\000\128\000\132\000\128\000\128B\136!\132 \132\000\132\000\128\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\034\132\001\128\001\132\223\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255{\235\000\128 \136\000\128J\173\206\185K\169\206\185\140\177\206\189\173\185\140\177\206\185\173\181\173\181\173\181\174\181\174\181\174\181\174\181\173\181\173\181\173\185\173\185\173\185\172\185\172\185\172\185\172\185\173\185\173\181\206\185\173\181\174\181l\173\034\132\034\136d\144:\235\255\255\190\247\255\255\189\247\255\255:\231\000\128 \132\000\1288\235\254\255\255\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\157\247d\144\000\132\133\148|\243\255\255\255\255\255\255R\202\000\128\001\128\000\132Y\239\221\255\222\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\255\254\255\254\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\157\247\166\152\000\128c\140s\210\255\255\255\255!\136\000\128\001\1329\231\189\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\251\255\255\255\255\255\251\255\251\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\251\255\255\255\255\255\255\255\255\254\251\254\255\255\255\255\255\189\247\156\247!\136\000\128\197\148\254\255\222\255J\173\000\128K\173\255\255\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\251\255\255\255\255\254\255\255\251\255\251\255\251\255\251\255\251\255\255\255\255\255\255\255\255\255\255\255\251\255\247\255\247\255\243\255\243\255\243\255\251\255\251\255\251\255\255\255\255\255\255\221\251\255\255\254\255\172\181\000\128)\165\254\255\255\255\239\193\000\128\174\181\222\251\255\255\255\255\255\255\255\255\255\251\255\251\255\251\255\251\255\255\255\255\254\255\255\251\255\251\255\251\254\251\255\255\255\255\255\255\255\255\255\255\255\251\223\243\157\227\092\215}\215]\211}\215\092\223;\219|\227\223\247\255\251\254\251\255\255\255\255\221\251\172\181 \128\205\181\255\255\254\255\140\181\000\128\140\177\255\255\255\255\255\251\255\255\255\255\255\255\255\251\255\247\255\251\255\251\255\255\254\255\254\251\254\251\254\251\254\255\254\255\255\255\255\255\255\255\255\255\255\247|\223\151\186\020\166\020\162\020\158\021\158\242\165\242\169\150\190|\227\255\247\254\251\254\255\254\255\254\255\139\177\000\128\140\177\255\255\221\247\015\190\000\128\238\185\255\251\255\251\255\255\255\255\255\255\255\251\190\239\092\227\157\231\223\243\255\255\255\255\255\255\254\251\253\255\253\255\254\255\222\255\255\255\255\255\255\251\255\247\092\215\020\166p\137\146\133\179\133\245\141\177\145o\141\019\166\092\215\255\247\255\251\255\255\254\255\255\255\015\190\000\128\239\189\223\255\221\251\172\177 \128\139\173\255\255\255\255\255\255\255\255\255\251\255\247\157\231u\190v\190~\227\191\239\255\251\255\251\254\251\253\255\253\255\254\255\222\255\255\255\255\255\255\251\255\247\092\215\020\162\146\133\213\133\023\138z\150W\154\210\141\020\162\092\211\255\247\255\251\255\255\255\255\255\255\140\177\000\128\141\177\255\255\255\255\206\185\000\128\205\181\255\255\255\251\255\255\255\255\255\251\255\247;\219\242\165\210\161\028\203\127\223\255\243\255\247\255\251\254\255\254\255\254\255\254\255\255\255\255\251\255\251\255\247\092\215\020\158\147\129\246\129Z\142\222\158\153\158\244\141\020\158\092\211\255\243\255\251\255\255\254\255\255\255\206\185\001\128\175\181\255\255\255\255\205\181\000\128\173\181\255\255\255\255\255\255\255\255\255\251\255\251\092\215\019\166o\141\212\157\153\182\127\219\255\243\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\247\092\215\020\162\179\133\246\129Z\142\222\158\186\158\244\1414\158]\215\255\247\255\255\255\255\254\255\255\255\173\181\001\128\173\177\255\255\255\255\173\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\243\092\2115\162\145\137q\133\021\158\220\186\158\223\255\239\255\251\255\255\255\255\255\255\255\251\255\255\255\255\255\251\092\219\020\162\179\133\214\129Y\142\189\158\186\154\243\141\020\158}\215\255\251\255\255\255\255\255\255\255\255\173\181\000\128\173\177\255\255\255\255\174\185\000\128\173\185\255\255\255\255\255\255\255\255\255\255\255\243~\215\020\158q\129r\129\146\137\244\149\151\186\159\227\255\255\255\255\223\255\255\255\255\251\255\251\255\255\255\251\092\219\020\162\146\133\213\133Y\146\221\158\186\158\243\141\020\162}\219\255\251\255\255\222\255\254\255\254\255\205\185\000\128\206\181\255\255\255\255\174\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\247}\215\020\158\146\133\148\133t\129t\129\243\149\217\186}\223\223\247\255\255\255\255\255\255\254\255\255\255\255\247^\219\022\166\148\137\214\133Z\142\221\158\186\158\244\1414\158}\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\174\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\247}\215\021\158r\129\148\129u\129\150\133\211\137\019\154\150\182|\227\255\255\255\255\222\251\255\255\254\255\255\247^\215\246\161\148\133\214\133Z\146\222\158\186\158\244\1414\158}\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\247~\215\021\158s\129u\129\150\129\184\133\212\129\178\133\019\158\183\190\157\227\255\247\255\251\254\255\255\255\255\247]\215\022\162\147\133\214\133Z\146\190\158\186\158\244\1414\158}\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\181\000\128\173\181\255\255\255\251\255\255\255\255\255\255\255\247^\215\021\158s\129\150\129\151\129\153\129\247\129\021\134\020\146T\162v\178}\219\223\243\255\255\255\255\255\251]\219\021\158\147\129\214\133Z\146\190\162\186\158\244\141\020\158}\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\181\000\128\173\181\255\255\255\251\255\255\255\255\255\255\255\247^\215\021\158t\133v\129\151\129\153\129\024\1308\1345\138\020\1425\158<\199~\223\223\247\255\255\255\251]\215\021\158\178\129\246\129Z\146\190\162\185\158\244\141\020\158}\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\185\000\128\173\181\255\255\255\251\255\255\255\255\255\255\255\251}\215\021\158s\129u\129\151\129\184\129\248\129Y\134x\138\152\146x\1546\158V\178\158\231\255\251\255\247}\2154\158\178\129\245\129Y\142\190\162\185\158\244\141\020\158}\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\185\000\128\173\181\255\255\255\251\255\255\255\255\255\255\255\251}\215\020\158r\129t\129\151\129\184\129\248\129Z\138\154\146\186\150\154\150\212\141\021\166]\223\255\251\255\247|\2154\158\177\129\245\129Y\142\190\158\185\158\244\1414\158|\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\181\000\128\173\181\255\255\255\251\255\255\255\255\255\255\255\251|\215\020\158\146\133t\129\150\129\183\129\216\129\024\134z\146\220\154\155\154\212\137\020\162;\215\255\251\255\247|\2154\158\177\129\245\129Z\142\190\158\185\158\244\1414\158|\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\247|\215\019\158\146\129\148\129\150\129\183\129\216\129\024\138Y\146y\150X\150W\158\152\182\157\227\255\251\255\247\092\2153\158\178\129\245\129Z\146\190\158\186\158\243\1414\158|\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\181\000\128\173\181\255\255\255\251\255\255\255\255\255\255\255\251}\215\020\158\146\129\148\129\149\129\183\129\250\137\025\142\246\141\021\1465\154\250\190}\215\255\247\255\251\255\247\092\2155\162\146\129\213\129Z\146\190\162\185\158\243\1414\158|\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\255\173\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\247}\215\021\158\147\133\149\129\150\129\183\129\184\129\247\137\245\1455\162\151\182\158\223\255\243\254\247\254\251\255\247]\2156\162r\129\214\129:\146\190\162\185\158\243\1414\158}\219\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\251\174\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\247~\211\021\154\147\133\181\129\183\133\183\133\182\129\180\133\021\158\249\194\157\223\223\239\255\255\254\255\254\255\255\247=\2116\162\147\129\214\133:\146\190\162\185\158\243\141\020\158|\215\255\251\255\255\255\255\255\255\255\255\173\181\000\128\173\181\255\255\255\251\174\181\000\128\173\181\255\255\255\255\255\255\255\255\255\255\255\243~\211\021\158r\129\149\133\182\133\150\133\214\141\245\149\151\182|\219\255\247\254\251\254\255\252\255\254\255\255\251=\211\246\157\148\129\214\133:\146\190\162\186\162\243\1414\158|\215\255\251\255\255\255\255\255\255\255\255\173\185\000\128\173\181\255\255\255\251\174\181\000\128\141\185\255\255\255\255\255\255\255\255\255\251\255\243}\2076\158q\129\148\129\148\129\148\133\212\153\218\190\191\227\255\247\255\255\254\255\254\255\253\255\254\255\255\251]\215\246\157\180\133\214\133Y\142\221\158\185\158\243\1414\158|\215\255\251\255\255\255\255\255\255\255\255\205\185\000\128\174\181\255\255\255\251\174\181\000\128\141\185\255\255\254\255\254\255\254\255\255\251\255\243|\2075\158\145\129\146\129\179\137\022\150\153\190~\219\223\243\255\255\255\255\255\255\254\255\253\255\254\255\255\251^\219\022\162\180\133\246\133z\142\221\158\152\158\243\137\019\158\092\215\255\251\255\255\255\255\255\255\255\255\205\185\000\128\174\181\255\255\255\251\174\181\000\128\141\185\255\255\255\255\254\255\254\255\255\251\255\243\157\211\019\154\145\129p\129\022\150\252\178\127\223\223\243\255\251\255\255\255\255\255\255\255\255\254\255\255\255\255\251]\215\021\158\147\129\246\133z\142\220\154\185\158\243\1414\158|\215\255\251\255\255\255\255\255\255\255\255\205\185\000\128\174\181\255\255\255\255\174\181\001\128\173\181\255\255\254\255\254\255\254\255\255\251\255\239}\215\018\158\143\145\018\162\151\182\157\215\254\251\255\255\255\255\255\255\255\251\255\251\255\255\254\255\255\255\255\243]\211\021\154\179\129\181\1299\142\222\158\186\158\244\1415\158~\211\255\243\255\251\255\255\255\255\255\255\173\181\000\128\173\181\255\255\255\255\206\185\001\128\173\181\255\255\222\255\254\255\254\255\254\251\255\243|\215\019\166\241\157\249\194}\215\255\235\255\255\255\255\255\255\255\255\255\251\255\251\255\255\254\255\255\255\255\243~\2155\158\212\137\246\137Z\146\222\162\186\162\244\141\020\158~\215\255\243\255\251\255\255\222\255\255\255\205\185\000\128\173\181\255\255\255\255\174\181\000\128\173\181\255\255\221\255\253\255\254\255\254\251\255\247\157\223\150\186\150\186\191\223\255\235\255\247\255\255\255\255\255\255\255\255\255\255\255\251\255\255\255\255\255\255\255\247]\211\244\153\146\133\212\133\023\142Z\150V\154\177\141\019\158~\219\255\247\255\251\255\255\255\255\255\255\173\181\000\128\173\181\255\255\255\255\207\185\000\128\173\181\255\255\254\255\253\255\253\255\255\255\255\251\255\239|\223}\223\255\243\255\247\255\251\254\255\254\255\255\255\255\255\255\255\255\251\255\255\255\255\255\255\255\247]\215\020\162\145\141\146\137\179\137\213\141\209\141\175\141\019\166]\219\255\243\255\255\255\255\254\255\255\255\205\181\000\128\173\181\255\255\255\255\174\181\000\128\173\177\255\255\254\255\221\255\254\255\254\255\254\247\255\251\255\243\255\247\255\251\255\251\255\255\254\255\255\255\255\255\255\255\255\255\255\251\255\255\255\255\255\255\255\251\157\227v\182\243\161\244\157\244\153\021\1583\162\018\162u\186\158\231\255\255\255\255\255\255\255\255\255\255\206\181\000\128\174\181\223\251\222\251\140\177\000\128\141\177\255\255\254\255\254\255\254\255\254\255\222\251\255\251\255\247\255\251\255\255\255\255\254\255\254\255\255\255\255\255\255\255\255\255\255\251\255\255\254\255\254\255\255\251\255\243\158\223}\219~\215]\215]\211|\211|\215\157\227\255\247\255\255\255\255\255\255\222\251\255\255k\173!\128\141\177\255\255\255\255\132\144\001\128B\136\155\243\221\255\254\255\221\255\255\255\255\255\255\251\255\251\255\251\255\255\255\255\254\255\254\255\255\255\255\255\255\255\255\251\255\255\255\255\254\255\254\255\254\255\255\251\255\247\255\243\255\247\255\247\255\243\255\239\255\239\255\247\255\255\255\255\222\255\255\255\255\255\156\243B\132\001\128c\136\255\255\255\255R\206!\136\001\132d\144\189\251\189\251\254\255\255\255\255\255\255\251\255\251\255\251\255\255\255\255\254\255\255\255\255\255\255\255\255\251\255\251\255\255\255\255\254\255\253\255\253\255\254\255\255\255\255\251\255\251\255\255\255\251\255\243\255\247\255\251\255\255\255\255\222\255\255\255\222\251c\140!\128c\1362\198\255\255\255\255\255\255\255\255c\140\000\132c\144\156\247\255\255\156\243\255\255\255\251\255\255\255\255\255\255\255\255\254\255\255\251\255\251\255\255\255\251\255\251\255\255\255\255\254\255\253\255\254\255\254\255\254\255\222\255\254\255\254\255\254\255\255\247\254\247\255\255\255\255\222\255\222\255\156\247c\140\034\132\165\144\189\243\255\255\255\255\255\255\222\255\254\255{\239\132\144\000\128B\136\140\177\140\177\140\1771\198K\169\141\177\174\185\174\185\173\185\205\181\205\181\174\181\174\181\174\181\174\181\173\181\172\185\204\189\205\185\205\181\205\185\173\185\173\189\205\189\204\189\204\177\238\185\172\181\173\185\205\189k\181B\140\000\128c\140\156\239\255\251\223\251\255\255\254\255\254\255\255\255\255\255\156\239B\132\000\128!\132\001\128\000\128\000\128!\132\001\132\000\128\000\128\000\132\000\128\000\128\000\128\001\128\001\128\001\128\000\128\000\132\000\128\000\128\000\128\000\128\000\128\000\132\000\132\000\128 \128\000\128\000\128\000\128\000\132\000\132\000\128c\140{\235\255\255\222\247\255\255\223\251\254\255\254\255\222\251\222\247\255\255s\202\165\144J\165\174\181\173\181\174\185\141\181\174\185\174\185\174\185\141\185\172\181\173\181\174\181\174\181\175\181\174\181\174\185\173\185\172\181\173\177\173\177\141\181\142\185\142\185\174\181\173\181\237\181\205\181\206\185\173\185\173\185\173\185C\140s\206\255\255\222\247\255\251\255\255\255\255\253\251\254\255\255\255\255\255\255\251\255\255\255\255\255\251\223\251\255\255\222\255\223\255\255\255\223\255\223\255\255\255\254\255\254\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\251\255\255\223\255\223\255\255\255\255\251\254\243\255\251\255\251\255\255\255\255\223\255\255\255\255\251\255\255\255\255\255\255\255\255\255\255") gen = 0 size=10 game={} density=1/2 speed=0.3 grid=true toral=true function on.create() h=platform.window:height() w=platform.window:width() resetgrid() cursor.show() end function on.mouseDown(x, y) for _, button in pairs(Buttons) do if button:onClick(x, y) then -- if button.img==play then -- Remove these 5 lines if you don't want the play button to swap -- button.img=pause -- This could obvious be tweaked to be different image names if you wanted -- elseif button.img==pause then -- Or just use other images in image.new(), but call them play/pause... -- button.img=play -- end -- End of section to remove button.func() platform.window:invalidate() end end i=math.floor((x+3)/size)-1 j=math.floor((y+2)/size)-1 if i>=0 and i<=cols-1 and j>=0 and j<=rows-1 then if grid==false then if game[i][j]==1 then game[i][j]=0 elseif game[i][j]==0 then game[i][j]=1 end else if game[i][j]==1 and ((x+3)/size~=math.floor((x+3)/size) or (y+2)/size~=math.floor((y+2)/size)) then game[i][j]=0 elseif game[i][j]==0 and ((x+3)/size~=math.floor((x+3)/size) or (y+2)/size~=math.floor((y+2)/size)) then game[i][j]=1 end end end end -- function on.mouseMove(x,y) -- xco=x -- yco=y -- ival=math.floor((x+3)/size) -- jval=math.floor((y+2)/size) -- end --xco=0 --yco=0 function on.paint(gc) for _,button in pairs(Buttons) do button:paint(gc) end gc:setPen("thin","smooth") gc:setColorRGB(0,0,0) gc:setFont("sansserif","r",6) strwidth = gc:getStringWidth(gen) gc:drawString(gen,w-25+((20-strwidth)/2),12) for i=0,cols-1 do for j=0,rows-1 do if game[i][j]==1 then if platform.isColorDisplay() then gc:setColorRGB(255,0,0) else gc:setColorRGB(20,20,20) end if grid==true then gc:fillRect((i)*size+6,(j)*size+6,size-1,size-1) else gc:fillRect((i)*size+5,(j)*size+5,size,size) end end if grid==true then gc:setColorRGB(0,0,0) gc:drawRect((i)*size+5,(j)*size+5,size,size) end -- gc:setColorRGB(0,0,0) -- gc:setFont("sansserif","r",6) -- gc:drawString(tostring(gameneighbour[i][j]),i*size-2,j*size+5) end end -- gc:drawString("("..tostring(xco)..","..tostring(yco)..")", w-70, h-30) -- gc:drawString("("..tostring(ival)..","..tostring(jval)..")", w-70, h-20) end function on.enterKey() playpause() end function on.backspaceKey() resetgrid() end function on.charIn(char) if char=="s" then if update==1 then playpause() end on.timer() end end function on.resize(width,height) --on change of window size (including mode change) recalculate the height and width w=width h=height resetgrid() end function playpause() for _, button in pairs(Buttons) do if button.img==play then -- Remove these 5 lines if you don't want the play button to swap button.img=pause -- This could obvious be tweaked to be different image names if you wanted elseif button.img==pause then -- Or just use other images in image.new(), but call them play/pause... button.img=play end -- End of section to remove end if update==1 then update=0 timer.stop() else update=1 timer.start(speed) end end function on.deactivate() end function changespeed() if update==1 then timer.stop() timer.start(speed) end end function resetgrid() Buttons={ Button.define(w-25, 15, 20,20,function() playpause() end, play, "Play/Pause","Animation"), Button.define(w-25, 35, 20,20,function() if update==1 then playpause() end on.timer() end, step, "Step","Animation"), Button.define(w-25, 55, 20,20,function() resetgrid() end, reset, "Reset","Animation"), Button.define(0, 0, 0,0,function() speed=1.2 changespeed() end, nil, "Very Slow","Speed"), Button.define(0, 0, 0,0,function() speed=0.5 changespeed() end, nil, "Slow","Speed"), Button.define(0, 0, 0,0,function() speed=0.3 changespeed() end, nil, "Medium","Speed"), Button.define(0, 0, 0,0,function() speed=0.25 changespeed() end, nil, "Fast","Speed"), Button.define(0, 0, 0,0,function() speed=0.17 changespeed() end, nil, "Very Fast","Speed"), Button.define(0, 0, 0,0,function() density=0 resetgrid() end, nil, "Empty","Density"), Button.define(0, 0, 0,0,function() density=0.1 resetgrid() end, nil, "Very Low Density","Density"), Button.define(0, 0, 0,0,function() density=0.3 resetgrid() end, nil, "Low Density","Density"), Button.define(0, 0, 0,0,function() density=0.5 resetgrid() end, nil, "Medium Density","Density"), Button.define(0, 0, 0,0,function() density=0.7 resetgrid() end, nil, "High Density","Density"), Button.define(0, 0, 0,0,function() size=2 grid=false resetgrid() end, nil, "Tiny","Grid Size"), Button.define(0, 0, 0,0,function() size=4 grid=false resetgrid() end, nil, "Very Small","Grid Size"), Button.define(0, 0, 0,0,function() size=7 grid=true resetgrid() end, nil, "Small","Grid Size"), Button.define(0, 0, 0,0,function() size=10 grid=true resetgrid() end, nil, "Medium","Grid Size"), Button.define(0, 0, 0,0,function() size=13 grid=true resetgrid() end, nil, "Large","Grid Size"), Button.define(0, 0, 0,0,function() size=16 grid=true resetgrid() end, nil, "Very Large","Grid Size"), Button.define(0, 0, 0,0,function() if grid==true then grid=false else grid=true end end, nil, "Grid On/Off","Grid"), Button.define(0, 0, 0,0,function() toral=true end, nil, "Toral Mode (Wrap Around Edges)","Grid"), Button.define(0, 0, 0,0,function() toral=false end, nil, "Edge Mode","Grid"), Button.define(0, 0, 0,0,function() preset("glider") end, nil, "Glider","Presets"), Button.define(0, 0, 0,0,function() preset("glidergun") end, nil, "Glider Gun","Presets"), Button.define(0, 0, 0,0,function() preset("diehard") end, nil, "Die Hard Methuselah","Presets"), Button.define(0, 0, 0,0,function() preset("blinkerpuffer") end, nil, "Blinker Puffer","Presets"), } if platform.isDeviceModeRendering() == true then toolpalette.enable("Grid Size", "Tiny",false) if size==4 then if speed<1 then speed = 1.2 changespeed() end toolpalette.enable("Speed", "Slow",false) toolpalette.enable("Speed", "Medium",false) toolpalette.enable("Speed", "Fast",false) toolpalette.enable("Speed", "Very Fast",false) elseif size==7 then if speed<0.5 then speed = 0.5 changespeed() end toolpalette.enable("Speed", "Medium",false) toolpalette.enable("Speed", "Fast",false) toolpalette.enable("Speed", "Very Fast",false) elseif size==10 then if speed<0.2 then speed = 0.3 changespeed() end toolpalette.enable("Speed", "Fast",false) toolpalette.enable("Speed", "Very Fast",false) elseif size==13 then if speed<0.25 then speed = 0.25 changespeed() end toolpalette.enable("Speed", "Very Fast",false) else toolpalette.enable("Speed", "Slow",false) toolpalette.enable("Speed", "Medium",true) toolpalette.enable("Speed", "Fast",true) toolpalette.enable("Speed", "Very Fast",true) end else toolpalette.enable("Grid Size", "Tiny",true) toolpalette.enable("Grid Size", "Very Small",true) end cols = math.floor((w-5-30)/size) rows = math.floor((h-10)/size) game={} for i=0,cols-1 do game[i]={} for j=0,rows-1 do game[i][j]=math.floor((math.random()+density)) end end gen=0 -- for i=1,20 do -- gameneighbour[i]={} -- for j=1,20 do -- gameneighbour[i][j]=0 -- end -- end platform.window:invalidate() end function preset(layout) density=0 resetgrid() if layout=="glider" then game[3][1]=1 game[3][2]=1 game[3][3]=1 game[2][3]=1 game[1][2]=1 elseif layout=="glidergun" then if cols<36 then size=7 resetgrid() end toral=false game[1][5]=1 game[1][6]=1 game[2][5]=1 game[2][6]=1 game[11][5]=1 game[11][6]=1 game[11][7]=1 game[12][4]=1 game[12][8]=1 game[13][3]=1 game[13][9]=1 game[14][3]=1 game[14][9]=1 game[15][6]=1 game[16][8]=1 game[16][4]=1 game[17][5]=1 game[17][6]=1 game[17][7]=1 game[18][6]=1 game[21][3]=1 game[21][4]=1 game[21][5]=1 game[22][3]=1 game[22][4]=1 game[22][5]=1 game[23][2]=1 game[23][6]=1 game[25][1]=1 game[25][2]=1 game[25][6]=1 game[25][7]=1 game[35][3]=1 game[35][4]=1 game[36][3]=1 game[36][4]=1 elseif layout=="diehard" then toral=true game[5][5]=1 game[5][6]=1 game[6][5]=1 game[6][6]=1 game[10][5]=1 game[11][6]=1 game[11][7]=1 game[12][5]=1 elseif layout=="blinkerpuffer" then if rows<20 then size=10 resetgrid() end toral=true game[cols-2][16]=1 game[cols-2][18]=1 game[cols-3][19]=1 game[cols-4][19]=1 game[cols-4][15]=1 game[cols-5][15]=1 game[cols-5][19]=1 game[cols-6][19]=1 game[cols-7][16]=1 game[cols-7][19]=1 game[cols-8][17]=1 game[cols-8][18]=1 game[cols-8][19]=1 game[cols-5][11]=1 game[cols-6][11]=1 game[cols-6][12]=1 game[cols-7][11]=1 game[cols-7][12]=1 game[cols-7][13]=1 game[cols-8][10]=1 game[cols-8][12]=1 game[cols-8][13]=1 game[cols-9][10]=1 game[cols-9][11]=1 game[cols-9][12]=1 game[cols-10][11]=1 game[cols-5][3]=1 game[cols-5][5]=1 game[cols-6][6]=1 game[cols-7][2]=1 game[cols-7][6]=1 game[cols-8][6]=1 game[cols-9][3]=1 game[cols-9][6]=1 game[cols-10][4]=1 game[cols-10][5]=1 game[cols-10][6]=1 end end --gameneighbour={} function on.timer() local gamenew gamenew={} gen=gen+1 stop=true for i=0,cols-1 do gamenew[i]={} -- gameneighbour[i]={} for j=0,rows-1 do if toral==true then neighbours = game[(i-1)%cols][(j-1)%rows]+game[(i-1)%cols][j]+game[(i-1)%cols][(j+1)%rows]+game[i][(j-1)%rows]+game[i][(j+1)%rows]+game[(i+1)%cols][(j-1)%rows]+game[(i+1)%cols][j]+game[(i+1)%cols][(j+1)%rows] else if i==0 then if j==0 then neighbours = game[i][j+1]+game[i+1][j]+game[i+1][j+1] elseif j==rows-1 then neighbours = game[i][j-1]+game[i+1][j-1]+game[i+1][j] else neighbours = game[i][j-1]+game[i][j+1]+game[i+1][j-1]+game[i+1][j]+game[i+1][j+1] end elseif i==cols-1 then if j==0 then neighbours = game[i-1][j]+game[i-1][j+1]+game[i][j+1] elseif j==rows-1 then neighbours = game[i-1][j-1]+game[i-1][j]+game[i][j-1] else neighbours = game[i-1][j-1]+game[i-1][j]+game[i-1][j+1]+game[i][j-1]+game[i][j+1] end elseif j==0 then neighbours = game[i-1][j]+game[i-1][j+1]+game[i][j+1]+game[i+1][j]+game[i+1][j+1] elseif j==rows-1 then neighbours = game[i-1][j-1]+game[i-1][j]+game[i][j-1]+game[i+1][j-1]+game[i+1][j] else neighbours = game[i-1][j-1]+game[i-1][j]+game[i-1][j+1]+game[i][j-1]+game[i][j+1]+game[i+1][j-1]+game[i+1][j]+game[i+1][j+1] end end if (game[i][j]==1 and neighbours<2) or (game[i][j]==1 and neighbours>3) then gamenew[i][j]=0 elseif (game[i][j]==1 and (neighbours==2 or neighbours==3)) then gamenew[i][j]=1 elseif (game[i][j]==0 and neighbours==3) then gamenew[i][j]=1 else gamenew[i][j]=0 end stop=stop and game[i][j]==gamenew[i][j] end end if stop then playpause() else game=gamenew end platform.window:invalidate() end ------ Code for Button ------ Button = {} Button.__index = Button function Button.define(x, y, w, h, func, img, text, menuroot) local btn = {} local addedtotable setmetatable(btn, Button) btn.x = x btn.y = y btn.w = w btn.h = h btn.img = img btn.func = func btn.text = text addedtotable=false if (menuroot~=nil and text~=nil) then for i=1,table.getn(menu) do if menu[i][1]==menuroot then table.insert(menu[i],{text, func}) addedtotable=true end end if addedtotable==false then table.insert(menu,{menuroot,{text, func},}) end end return btn end function Button:onClick(x, y) return (x >= self.x) -- Check if click occoured where the button is! and (x <= self.x + self.w) and (y >= self.y) and (y <= self.y + self.h) end function Button:paint(gc) if self.img~=nil then gc:drawImage(self.img:copy(self.w,self.h),self.x,self.y) elseif self.text~=nil and (self.w~=0 or self.h~=0) then strwidth=gc:getStringWidth(self.text) if strwidth>self.w then self.w = strwidth*1.2 -- if the text is bigger than the button, resize the button! end gc:setColorRGB(180, 180, 180) gc:fillRect(self.x, self.y, self.w, self.h) gc:setColorRGB(0, 0, 0) gc:setPen("medium","smooth") gc:drawRect(self.x, self.y, self.w, self.h) gc:setFont("sansserif", "r", 10) gc:drawString(self.text, self.x + (self.w-strwidth)/2, self.y+self.h/2, "middle") elseif self.w~=0 or self.h~=0 then gc:fillRect(self.x, self.y, self.w, self.h) end end ------ End of Button Code ------ h=0 w=0 menu={} Buttons={ Button.define(w-25, 15, 20,20,function() playpause() end, play, "Play/Pause","Animation"), Button.define(w-25, 35, 20,20,function() if update==1 then playpause() end on.timer() end, step, "Step","Animation"), Button.define(w-25, 55, 20,20,function() resetgrid() end, reset, "Reset","Animation"), Button.define(0, 0, 0,0,function() speed=1.2 changespeed() end, nil, "Very Slow","Speed"), Button.define(0, 0, 0,0,function() speed=0.5 changespeed() end, nil, "Slow","Speed"), Button.define(0, 0, 0,0,function() speed=0.3 changespeed() end, nil, "Medium","Speed"), Button.define(0, 0, 0,0,function() speed=0.25 changespeed() end, nil, "Fast","Speed"), Button.define(0, 0, 0,0,function() speed=0.17 changespeed() end, nil, "Very Fast","Speed"), Button.define(0, 0, 0,0,function() density=0 resetgrid() end, nil, "Empty","Density"), Button.define(0, 0, 0,0,function() density=0.1 resetgrid() end, nil, "Very Low Density","Density"), Button.define(0, 0, 0,0,function() density=0.3 resetgrid() end, nil, "Low Density","Density"), Button.define(0, 0, 0,0,function() density=0.5 resetgrid() end, nil, "Medium Density","Density"), Button.define(0, 0, 0,0,function() density=0.7 resetgrid() end, nil, "High Density","Density"), Button.define(0, 0, 0,0,function() density=0.9 resetgrid() end, nil, "Very High Density","Density"), Button.define(0, 0, 0,0,function() size=2 grid=false resetgrid() end, nil, "Tiny","Grid Size"), Button.define(0, 0, 0,0,function() size=4 grid=false resetgrid() end, nil, "Very Small","Grid Size"), Button.define(0, 0, 0,0,function() size=7 grid=true resetgrid() end, nil, "Small","Grid Size"), Button.define(0, 0, 0,0,function() size=10 grid=true resetgrid() end, nil, "Medium","Grid Size"), Button.define(0, 0, 0,0,function() size=13 grid=true resetgrid() end, nil, "Large","Grid Size"), Button.define(0, 0, 0,0,function() size=16 grid=true resetgrid() end, nil, "Very Large","Grid Size"), Button.define(0, 0, 0,0,function() if grid==true then grid=false else grid=true end end, nil, "Grid On/Off","Grid"), Button.define(0, 0, 0,0,function() toral=true end, nil, "Toral Mode (Wrap Around Edges)","Grid"), Button.define(0, 0, 0,0,function() toral=false end, nil, "Edge Mode","Grid"), Button.define(0, 0, 0,0,function() preset("glider") end, nil, "Glider","Presets"), Button.define(0, 0, 0,0,function() preset("glidergun") end, nil, "Glider Gun","Presets"), Button.define(0, 0, 0,0,function() preset("diehard") end, nil, "Die Hard Methuselah","Presets"), Button.define(0, 0, 0,0,function() preset("blinkerpuffer") end, nil, "Blinker Puffer","Presets"), } toolpalette.register(menu)