lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 16/08/16 09:57 PM, Martin wrote:
Occasionally discovered while experimenting with syntax parser:

Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
print(0)
0
print(~0)
-1
print(-~0)
1
print(~-~0)
-2
print(-~-~0)
2
print(~-~-~0)
-3
print(-~-~-~0)
3
print(~-~-~-~0)
-4
print(-~-~-~-~0)
4

May use "1" too.


local x = 10 while x < 100 do print(x) x = -~x end

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.