• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] can anyone verify if you can use base 2 in World Editor?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Very few languages support base 2. You can convert to hex from base 2 in like 3 seconds so this is no major problem.

Infact, only recently did java receive base2 support. I guess this is because the average computer scientist is becomming less and less good at programming that they can not reliable use hex anymore (despite taking many courses involving it).

Code:
 0 - 0 - 0000
 1 - 1 - 0001
 2 - 2 - 0010
 3 - 3 - 0011
 4 - 4 - 0100
 5 - 5 - 0101
 6 - 6 - 0110
 7 - 7 - 0111
 8 - 8 - 1000
 9 - 9 - 1001
10 - A - 1010
11 - B - 1011
12 - C - 1100
13 - D - 1101
14 - E - 1110
15 - F - 1111

Thus 0b111 should be 0x7

The only time that raw binary is vaguly useful is for setting specific flags (eg for a memory mapped micro controler).

Raw binary has tons of disadvantages (why it was never majorly used). If you have a 64 bit value (common nowdays), that is 64 binary digits. Now imagine you have a 64 bit binary number.
0b1010101010101010101010101010101010101010101010101010101010101010
You could easilly get confued over digit placement compared with hex.
0xAAAAAAAAAAAAAAAA

Hex is a reduction in characters to count of 1/4. Additionally, the characters are much more distinct (base 16 not base 2) so your brain is less likly to misscount or get lost.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Oh no, I was just curious to see if WE supported binary. I learned that google supported it.
convert 7 to binary
google would give like 7 = 0b111
Thats because some languages do support binary like that.
Python or Java 1.7 (released recently) for example do.

Most C/C++ compilers do not however nor did older versions of Java (1.6 or earlier).

On the contary, hex support seems prety universal even among scripting languages (its one of the few things WC3 can do lol).
 
Status
Not open for further replies.
Top