The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
kyle7273 (2) [Avatar] Offline
Thanks for helping me with the code, i was up and creating my own game in no time, but is it against the lisence to share the edited code and image files on my website?
warren.sande (211) [Avatar] Offline
Re: Your sking game
Our code (and images) are distributed under the MIT license, which allows you to:
" use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, ... subject to the following conditions:

The <original> copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software."

We include the permission notice by including a link to the MIT License web site in the header comments.

You should leave those original copyright comments there, and then add your own underneath.

There is no problem posting the code or images on your web site.

Your header comments would look something like this:

# Copyright Kyle, 2011
# Based on, Copyright Warren Sande, 2009
# Released under MIT license
# Modified by Kyle. is also released under the MIT license.
kyle7273 (2) [Avatar] Offline
Re: Your sking game
i also have this error:
since round is a python command i cant set a vaue fo it without it saying a bunch of stuff so i did this:
rounddd = 015202 and python says it as 6786

and this part is important becuse it powers my savecode system.
any help needed.

warren.sande (211) [Avatar] Offline
Re: Your sking game

You were truing to use a variable called 'round'? Yes, that is the name of one of Python's built-in functions, which rounds off a float to the nearest integer.

So, you changed the variable name to 'rounddd'? That should work fine. The reason you're getting this "strange" result is that integers with a leading '0' are interpreted as octal numbers (base smilie in Python.

>>> n = 015202
>>> print n

>>> n = 15202
>>> print n

The leading zero in the first case makes Python think you are trying to set the value of n in octal, not decimal. If you want the decimal value, there are a few things you can do:

a) remove the leading zero

b) do this:
>>> n = int('015202',10)
>>> print n

Hope this helps,

Warren Sande