Can someone make me a function that posts to a PHP script and returns the result? I have this that I found on a Lua forum, but I can't get it working. local http = require "socket.http" local ltn12 = require "ltn12" function postForm(url, body) local sink, responseData = ltn12.si...
You need to create a copy of the board and compare your next generation against that instead of against the current generation as your calculating it. That's why it's going over to the left
You want string manipulation: http://www.lua.org/manual/2.4/node22.html specifically, strsub: strsub (s, i, [j]) Returns another string, which is a substring of s , starting at i and runing until j . If j is absent, it is assumed to be equal to the length of s . Particularly, the call strsub(s,1,j) ...