largest variable

dose anyone know what the largest variable the arduino can hold ... i made a game and i want to make sure the score dose not exceed that

Power of two:
22048 = 323,170,060,713,110,073,007,148,...,193,555,853,611,059,596,230,656 (617 digits)

thank you...

Sounds more like a game design issue :P.

Think more like XP => Levels.

No one likes to read "212130132" as a score.

And that's what happens when people ask ill-defined questions.

brendan dude - not that you deserve this - but you probably need to go see the docs for stdint.h.

brenden_nerd_:
dose anyone know what the largest variable the arduino can hold ... i made a game and i want to make sure the score dose not exceed that

The number range depends on the type of the variable.
This is NOT specific to Arduino, it is specific for programming languages in general.
Some variable types like 'int' may be platform dependent, i.e. 16-bit on 8-bit Atmegas or 32-Bit on PCs.

Integer type variables are also available in two subtypes "signed" and "unsigned".

A 'byte' can hold values from 0 up to 255
An 'uint8_t' 'int8_t' can hold values from -128 to 127

An 'int' can hold values from −32768 to 32767
An 'unsigned int' values from 0 to 65535

A 'long' holds values from −2147483648 up to 2147483647
An 'unsigned long' values from 0 to 4294967295

Those are commonly used data types.

Which range do you actually need for the score?

i made a game and i want to make sure the score dose not exceed that

You are thinking about this the wrong way round. What is the largest possible score ? Is there a variable type large enough to hold that number ? If not then you will need a different strategy or a different way of scoring.

An unsigned long will hold numbers in the range 0 to 4,294,967,295. I don't know what sort of scoring your game will have but even if you can score at 1 point per millisecond you would need to play for over 49 days to exceed that range.

If you want to be really silly you could use the BigNumber library from BigNumber library Nick Gammon gives examples of numbers up to 71569457046263802294811533723186532165584657342365752577109445058227039255480148842668944867280814080000000000000000000 but they could be larger !

Power of two:
22048 = 323,170,060,713,110,073,007,148,...,193,555,853,611,059,596,230,656 (617 digits)

That's true, if you only use 256 bytes of the available RAM.

(it's worth noting, anyway, that 22048 is about 1080 times the number of particles in the observable universe, or about 10565 years worth of Planck times.)

Johnny010:
Sounds more like a game design issue :P.

Think more like XP => Levels.

No one likes to read "212130132" as a score.

Really? I would think it would be gratifying.

A one-in-2267709 chance is all it takes to be rescued from certain death in deep space by a passing spaceship.

AWOL:
A one-in-2267709 chance is all it takes to be rescued from certain death in deep space by a passing spaceship.

But only if you have your towel.

KeithRB:
But only if you have your towel.

I hope you're not suggesting I don't know where mine is.

That's true, if you only use 256 bytes of the available RAM.

You did notice the moniker.