r/programminghelp • • Apr 10 '16

Python, attempting to figure out why my code always rounds down instead of just using the given value.

I'm sorry for including all of the code instead of any tiny relevant bits, but that's probably actually useful. When you run the program and insert the variables, ARMROTS always is rounded down to the nearest whole number.

http://pastebin.com/33XhsvHX

4 Upvotes

23 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Apr 11 '16

[deleted]

1

u/TangleF23 Apr 11 '16 edited Apr 11 '16

Sorry, but I doubt I can help with the gravity things- I have less knowledge of the math behind that than I do of programming.

To be totally honest, the program is really just for people to have fun with. Originally, it was for making maps of space empires, and that's probably gonna be its most interesting purpose in its current form.

Also, figured out problem in code- no int(PNGSIZE) in elliptical-based ones.

1

u/TangleF23 Apr 11 '16

Also, next idea: making the spiral arms enter the hub, like this:

http://33.media.tumblr.com/9a92c0da0c7718825eddc8c31483047e/tumblr_inline_n1xqwd17Uv1suuaas.png

0

u/[deleted] Apr 12 '16

[deleted]

1

u/TangleF23 Apr 12 '16 edited Apr 12 '16

Another thing of note: It would be interesting to get this thing to 64bit or get something else to allow the program to create truly gargantuan galaxies- I tried creating a 30-million-star one and it crashed, and I think it was memory-related, even though it crashed at 1.7 gb usage... so creating a 60-million might take 4.5 or something, and 120 maybe 10 gb...

0

u/[deleted] Apr 12 '16

[deleted]

1

u/TangleF23 Apr 12 '16

Huh, weird. I remember installing 64bit, cause yknow my computer's 64bit. Let me fix that and try again...

1

u/TangleF23 Apr 12 '16

Yeah, it's definitely 32bit, even though I installed 64bit TWICE.

0

u/[deleted] Apr 12 '16

[deleted]

1

u/TangleF23 Apr 12 '16

Yep, working now. Unfortunately, it can't really do anything above 30 million with my comp (although that's absolutely fine...)

0

u/[deleted] Apr 12 '16

[deleted]

1

u/TangleF23 Apr 12 '16

~13 million.

1

u/TangleF23 Apr 12 '16

Okay, gravity fix idea: odd number of pixels in image?