Results 1 to 19 of 19

Thread: Why is 255 the magic number?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Strawberry (Level 2)
    Join Date
    Apr 2006
    Posts
    573
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default Why is 255 the magic number?

    ??????

  2. #2
    Cherry (Level 1) modest9797's Avatar
    Join Date
    May 2008
    Location
    Pennsylvania
    Posts
    307
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Xbox LIVE
    modest9797

    Default

    Could you explain a little more?
    Xbox Live : modest9797
    Games I Want
    PS1: 2% PS2: 0%
    Xbox: 42% GC: 18%

  3. #3
    Insert Coin (Level 0)
    Join Date
    May 2005
    Posts
    56
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Because it's the largest number that can be stored in a single byte.
    Last edited by Amos; 05-18-2008 at 03:51 PM.

  4. #4
    Bell (Level 8)
    Join Date
    Jul 2002
    Location
    St. Louis, Mo
    Posts
    1,660
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by Amos View Post
    Because it's the largest number that can be stored in a single byte.
    we have a winner.

  5. #5
    Flawless Rawkality Flack's Avatar
    Join Date
    Aug 2003
    Location
    OKC, OK
    Posts
    14,273
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    3 Posts

    Default

    In base 2, 255 = 11111111.

    Per Wikipedia: This number occurs especially frequently in video games when a small number is needed, such as in the original The Legend of Zelda for the Nintendo Entertainment System where the maximum number of Rupees (the currency of the game) is 255. In Metroid Prime, for the Nintendo Gamecube, 255 is the maximum number of missiles Samus Aran can hold. In the Madden NFL series, the maximum points you can score is 255. If more points are scored, the game score remains at 255 regardless. In Starcraft, the maximum number of kills shown for a unit is 255. In Square Enix's Final Fantasy series, it is often the maximum value for any given stat. In Pac-Man, the highest level you can reach is 255, The game glitches from that point on. In World of Warcraft although the game level cap is only 70, the engine supports up to 255. The usage of 8 bits for storage in older videogames has had the consequence of it appearing as a hard limit in many videogames. It was often used for numbers where casual gameplay would not cause anyone to exceed the number. However in most situations it is reachable given enough time. This can cause many other peculiarities similar to the above listed to appear when the number wraps back to 0.

    Brought to you by Tootie.


  6. #6
    Peach (Level 3)
    Join Date
    Jan 2005
    Posts
    757
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    255 is the largest number you can put in a single byte unless you're using two's compliments to represent negatives. In that case, 11111111 actually is -1 and the largest number you can have is 127 which is 01111111.

  7. #7
    Insert Coin (Level 0) majinbuu's Avatar
    Join Date
    Jan 2006
    Location
    Perth, Western Australia
    Posts
    189
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Like the other guys said, a single byte can hold 256 values, from 0 to 255. Since a byte equals 8 bits, this works particularly well on 8 bit machines.

    Visually: A byte looks like this xxxxxxxx, where x is a 0 or a 1 and each x represents 1 bit. So you can have 01010101, 11111111, 00110011 and so on. Doing the math, since each bit can be in one of two states, and there are 8 of them, 2^8=256.

    I hope that made sense

    Sam
    I like turtles

  8. #8
    Cherry (Level 1)
    Join Date
    Mar 2004
    Location
    cleveland
    Posts
    286
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    dont forget hexadecimal ff=255
    you will see hex used in many cheat deviced aka action replay, cheats ending in 63hex = 99 dec for 99 lives or ff used for maxed life.

    In mathematics and computer science, hexadecimal (also base-16, hexa, or hex) is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or a through f) to represent values ten to fifteen.

    Its primary use is as a human friendly representation of binary coded values, so it is often used in digital electronics and computer engineering. Since each hexadecimal digit represents four binary digits (bits)—also called a nibble—it is a compact and easily translated shorthand to express values in base two.

Similar Threads

  1. Number of games???
    By eolsen in forum Classic Gaming
    Replies: 2
    Last Post: 12-01-2003, 07:51 PM
  2. Where to find pin number???
    By aaron_157 in forum Buying and Selling
    Replies: 4
    Last Post: 11-25-2003, 01:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •