cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Since Lua has no official support for these types of operations (or at least Lua 5.1) and I can't implement them C-sided since, well, I don't own Roblox (and I plan on making a GUI-based game on Roblox).
Anyways, to the point: How are some efficient ways to implement the OR and AND operations (bit-shifting was easy since all I needed was powers and division) without string manipulation? |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Bump |
|
|
If I'm not mistaken, Lua 5.2 allows you to do this, correct?
|
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Yeah I believe there is a "bit32" table IIRC |
|
|
I thought so.
I wonder why ROBLOX won't implement Lua 5.2. |
|
|
From the Lua.org website:
Lua 5.2 was released on 16 Dec 2011. Its main new features are yieldable pcall and metamethods, new lexical scheme for globals, ephemeron tables, new library for bitwise operations, light C functions, emergency garbage collector, goto statement, and finalizers for tables. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
I assume their sandboxing includes functions not available in Lua 5.2 (setfenv, getfenv, newproxy, etc.) and they don't want to make it compatible and they don't want to make some scripts break. |
|
|
They could just re-implement the built-in ROBLOX functions into Lua 5.2
|
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Lua 5.3 yay
http://www.lua.org/work/doc/ |
|
|
What will Lua 5.3 include?
|
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
support for integers (64-bit by default)
better support for small architectures ("Small Lua" with 32-bit numbers)
bitwise operators
basic utf-8 library
utf-8 escapes in literal strings
functions for packing/unpacking numbers
userdata can have any Lua value as uservalue
strip option in lua_dump/string.dump
BITWISE operators is the only thing I'm looking forward to (and if integers are actually 64-bit, can the bit operators be used on them O_o it's like something JavaScript hasn't done yet) |
|
swmaniacJoin Date: 2008-06-28 Post Count: 15773 |
I picked up this model a while ago:
http://www.roblox.com/Bitwise-Operations-item?id=55099988
I haven't found any particular use for it; I'd be interested to hear what you're doing that requires bitwise operations. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
I'll take a look at it, thanks in advanced.
Also, it's just for a poker hand analyzer (as opposed to an older brute-force search that was terribly inefficient). |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
in advance* and I'm just remaking one I made a long time ago that required a gigantic lookup table. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
That source seems to use string manipulation which is not really what I am aiming for. If last comes to last I guess I'll do it that way. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Bump |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Bump |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Bump |
|
MHebesJoin Date: 2013-01-04 Post Count: 2278 |
I know nothing about bitwise operators and should probably look them up, but here's a script that blocco made that maybe/probably won't be helpful:
http://www.roblox.com/Edge-Specific-Outlines-item?id=126404193
I only post it because it has some functions that look nifty. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
I'll take a look at it, also they're not complicated and anyone can learn them in probably 10 minutes or less |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Oo thanks |
|