|
| 20 Aug 2011 01:11 PM |
Here is some code I ran as a lua file in a stand alone interprater. When I use the command math/math.huge it displays the same value as the line math/1/0 (true, 1.#INF)
So obviously 1/0 has a numerical value, infinity! :D
I know there are flaws in the logic but hey, its kind of cool.
heres the code btw
while true do input = io.read("*line") com = string.sub(input, 1, 5) inc = string.sub(input, 6, string.len(input)) if com == "rlua/" then local iFunc = loadstring(inc) local op = pcall(iFunc) if op then print(op) end end if com == "disp/" then print(inc) end if com == "tbyt/" then local x = 0 for i=1, string.len(inc) do x = x + string.byte(string.sub(inc, i, i)) end print(x) end if com == "sbyt/" then for i=1, string.len(inc) do print(string.byte(string.sub(inc, i, i))) end end if com == "math/" then --[[Math command]] local inc = " return " .. inc local rslt = loadstring(inc) print(pcall(rslt)) end end |
|
|
| Report Abuse |
|
|
MoarData
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 53 |
|
| |
|
|
| 20 Aug 2011 01:15 PM |
@Moar print(string.char(78, 79, 32, 85)) |
|
|
| Report Abuse |
|
|
MoarData
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 53 |
|
| |
|
| |
|
|
| 20 Aug 2011 01:34 PM |
elseif is overrated.
-t3h n0b |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2011 01:36 PM |
| No the only overrated things, that will always excists, are Scripts! |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Aug 2011 01:39 PM |
2 reasons I don't use elseifs (in this case) a) some commands may overlap functionality b) I like to keep each block seperate for readability reasons. |
|
|
| Report Abuse |
|
|
| |
|
MoarData
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 53 |
|
|
| 20 Aug 2011 01:51 PM |
| I think elseif would run faster than lots of if blocks. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2011 02:02 PM |
| loadstring(10724/234234/53/345/56//t5/546/65/7/6/7/456/45/654/4/35/3/6/54/6/7/76/8/89//4/6/5//5/4/546//45/765/7/7/8/7//67/8/8//3/5/43/53/2/5/25//56/5/7/7/8/87/9//54/7/547) |
|
|
| Report Abuse |
|
|