cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:01 PM |
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? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 21 Jul 2014 06:19 PM |
If I'm not mistaken, Lua 5.2 allows you to do this, correct?
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:21 PM |
| Yeah I believe there is a "bit32" table IIRC |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2014 06:21 PM |
I thought so. I wonder why ROBLOX won't implement Lua 5.2. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2014 06:22 PM |
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. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:23 PM |
| 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. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2014 06:24 PM |
They could just re-implement the built-in ROBLOX functions into Lua 5.2
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:26 PM |
Lua 5.3 yay http://www.lua.org/work/doc/ |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2014 06:27 PM |
What will Lua 5.3 include?
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:30 PM |
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) |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 21 Jul 2014 06:42 PM |
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. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:51 PM |
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). |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:52 PM |
| in advance* and I'm just remaking one I made a long time ago that required a gigantic lookup table. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jul 2014 06:56 PM |
| 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. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 24 Jul 2014 12:55 AM |
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. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Jul 2014 12:58 AM |
| I'll take a look at it, also they're not complicated and anyone can learn them in probably 10 minutes or less |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|