uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
|
| 09 Apr 2014 07:33 AM |
| http://www.roblox.com/uomevip-39-s-Binary-Converter-item?id=152794964 |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 09 Apr 2014 07:34 AM |
| ya uhmn that's rly useful if I ever feel too lazy to modulo 2 |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 07:35 AM |
| The problem is that is so easy :/. |
|
|
| Report Abuse |
|
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
|
| 09 Apr 2014 07:36 AM |
@Taa You can't module binary @flat You need knowledge of converting binary, tables, and more |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 09 Apr 2014 07:37 AM |
| recursively modulo a number with 2, rest 1 or rest 0. Done |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 07:39 AM |
You need knowledge of converting binary, tables, and more -------------------------- You need the binary alphabet, tables for that alphabet, a loop that looks like this: for x in string.gmatch("pattern", string) do another for loop and that is about it. |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 09 Apr 2014 07:40 AM |
| It's a 5 line script if you modulo 2 a number and return the rest each time, no tables whatsoever |
|
|
| Report Abuse |
|
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
|
| 09 Apr 2014 07:41 AM |
@Taa No... To convert 1111 to decimal you need to make like a chart, I don't need to cause I memberized it, but it needs to be like this: 1|2|4|8 1|1|1|1 Since there is a one in each 8 + 4 + 2 + 1 = 15 |
|
|
| Report Abuse |
|
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
|
| 09 Apr 2014 07:44 AM |
@Flat Binary "Alphabet"? Get out please. |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 07:45 AM |
Binary "Alphabet"? Get out please. ----------- http://www.convertbinary.com/alphabet.php
-_- |
|
|
| Report Abuse |
|
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
|
| 09 Apr 2014 07:46 AM |
@Flat This thread is about converting to DECIMAL. |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 07:47 AM |
This thread is about converting to DECIMAL. ---------------- Good job on explicitly stating this in the OP or any other post besides this one. |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 09 Apr 2014 07:48 AM |
| You are a bit moronic if you write it down instead of using math.pow(i,2) |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 09 Apr 2014 08:01 AM |
function tonumer(bin) s = string.reverse(bin) temp = 0 for i = 1,string.len(s) do if tonumber(string.sub(s,i,i)) == 1 then temp = temp + math.pow(2,i) end end return temp end
print(tonumer(1111)) |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 08:24 AM |
CANT SET A FUNCTION NAME AFTER AN ACTUAL THING lel,caps
print (tonumber(685h854t)) 685854
|
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 09 Apr 2014 09:38 AM |
Binary to Decimal, it's modulo 2 to modulo 10.
If you want it even quicker, write hex to dec (Modulo 16 to modulo 10).
0xffffff <--- White, or three bytes of 1's.
--Shira |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2014 09:49 AM |
The peak of my scripting career; a binary to decimal converter; function toDecimal(Binary) return tonumber(Binary, 2) end |
|
|
| Report Abuse |
|
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
|
| 09 Apr 2014 09:54 AM |
All your binary functions did not work @Art 10:53:01.556 - Workspace.Script:4: attempt to call global 'todecimal' (a nil value) 10:53:01.557 - Script 'Workspace.Script', Line 4 10:53:01.558 - stack end @Taa 16383, Witch is the wrong answer BTW, I was using 0101 |
|
|
| Report Abuse |
|
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
| |
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
| |
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
| |
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 09 Apr 2014 10:00 AM |
local decimal = 504 local hex local bin
function tobin(dec) bin = tonumber(dec, 0x2) end
function tohex(dec) hex = tonumber(dec, 0xf1) end |
|
|
| Report Abuse |
|
|
uomevip
|
  |
| Joined: 31 Jul 2011 |
| Total Posts: 1695 |
|
|
| 09 Apr 2014 10:00 AM |
@Art I can't tell witch is your's, just ignore my comments |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 09 Apr 2014 04:37 PM |
| I wrote it in a minute and in the hurry forgot to make it start with 2^0, it does 2^1 as the first digit and thus ends up wrong by one bit |
|
|
| Report Abuse |
|
|
zomg44
|
  |
| Joined: 30 Sep 2008 |
| Total Posts: 5678 |
|
| |
|