hanyuone / Ways-to-NOT-make-money

A basic Python (2.x/3.x) incremental game.
8 stars 3 forks source link

fix for game_model not loading lottoprice #93

Closed joshgit closed 8 years ago

hanyuone commented 8 years ago

@joshgit Wait wait wait, why are you removing the -illions? They were required so that the money, when loaded from the savefile, wouldn't reach an OverflowError so quickly.

Also, is this the Py2 version or Py3 version? As well as that, you're back? When?

@DerpfacePython because the illions shouldn't be necessary. They weren't even being used as far as I saw, and Python should automatically convert numbers to big integer, infinitely sized integers.

This is all py3. Yes, I'm back. I got bored.

hanyuone commented 8 years ago

No, but when the games to savefile, the number for money gets carried over. Also, because we're setting money to int, the money will get large enough to Overflow. You should probably change the thing to long as well. (I'm not really sure what goes on, but it wouldn't convert through savefile for Python 2).

Also, the class that you made for Py2 for game_model had all these getter and setter functions (e.g. get_printmoney) - why were they in there?

ghost commented 8 years ago

I'm not really sure what goes on, but it wouldn't convert through savefile for Python 2

What do you mean? Python 3 uses ASCII 85-base encoding into bytes, but Python 2 uses string hexadecimal encoding...

ghost commented 8 years ago

You should probably change the thing to long as well

The long data type got removed in python 3. Proof:

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 63438726487326587465876328764873264873265482376463258732465874365874365837465873276487326
63438726487326587465876328764873264873265482376463258732465874365874365837465873276487326
>>> long
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    long
NameError: name 'long' is not defined
>>> 
joshgit commented 8 years ago

It's still transparently handling integer numbers that are too large to fit into an int. $python3 Python 3.5.1+ (default, Feb 24 2016, 10:41:47) [GCC 5.3.1 20160222] on linux Type "help", "copyright", "credits" or "license" for more information.

2 * 32 4294967296 2 * 64 18446744073709551616 2 \ 128 340282366920938463463374607431768211456 int('9999999999999999999999999999999999999999999999999999999999999999999') 9999999999999999999999999999999999999999999999999999999999999999999

hanyuone commented 8 years ago

Oh.

Well, by all means, go ahead.