Jump to content

How to make a simple game with Python on iOS .


7 posts in this topic

Recommended Posts

Posted

Hello guys today I will be showing you how to make a simple game with Python on iOS .

Requirements:

-device running iOS

- pythoni , you can get it from the App Store .

It is free.

In this tutorial I will be using pythoni .

And a last thing guys before I start : in this tutorial I will be not using hidden contents but if you have an account you can press the thanks button .

Remember that you can change some things and modify the game , in a certain way I will hack.????

So now the code , I recommend you to copy and paste it on pythoni in the section Python or script and not in console.

 

 

import random

secret = random.randint(1,50)

tipp = 0

essays = 0

print "hello my name is fred and i have a secret , it is a number between 1 and 50 . you have 4 essays"

while tipp != secret and essays < 8:

tipp = input("So what are you saying:")

if tipp < secret:

print "not enough:"

elif tipp > secret:

print "too high:"

essays = essays + 2

if tipp > 50:

print "this is not a number between 1 and 50."

if essays == 8:

print "Sorry you lost"

print "my secret was :", + secret

 

if tipp == secret:

print "Congratulation you won"

Posted

Oh yeah and I forgot when you run the script it will say you wrong indent ant block or something like that so to solve this problem here is the code:

 

import random

secret = random.randint(1,50)

tipp = 0

essays = 0

print "hello my name is fred and i have a secret , it is a number between 1 and 50 . you have 4 essays"

while tipp != secret and essays < 8:

tipp = input("So what are you saying:")

if tipp < secret:

print "not enough:"

elif tipp > secret:

print "too high:"

essays = essays + 2

if tipp > 50:

print "this is not a number between 1 and 50."

if essays == 8:

print "Sorry you lost"

print "my secret was :", + secret

 

if tipp == secret:

print "Congratulation you won"

Posted (edited)

Oh yeah and I forgot when you run the script it will say you wrong indent ant block or something like that so to solve this problem here is the code:

 

import random

secret = random.randint(1,50)

tipp = 0

essays = 0

print "hello my name is fred and i have a secret , it is a number between 1 and 50 . you have 4 essays"

while tipp != secret and essays < 8:

tipp = input("So what are you saying:")

if tipp < secret:

print "not enough:"

elif tipp > secret:

print "too high:"

essays = essays + 2

if tipp > 50:

print "this is not a number between 1 and 50."

if essays == 8:

print "Sorry you lost"

print "my secret was :", + secret

 

if tipp == secret:

print "Congratulation you won"

 

This is going to fail. :p

 

Whitespace is essential in python :)

Updated by KingRalph
Posted

Oh yeah guys I know how to fix the space problem . You just have to copy this code without the # at the beginning. Hope it works.

 

#import random

#secret = random.randint(1,50)

#tipp = 0

#essays = 0

#print "hello my name is fred and i have a secret , it is a number between 1 and 50 . you #have 4 essays"

#while tipp != secret and essays < 8:

# tipp = input("So what are you saying:")

# if tipp < secret:

# print "not enough:"

# elif tipp > secret:

# print "too high:"

# essays = essays + 2

# if tipp > 50:

# print "this is not a number between 1 and 50."

#if essays == 8:

# print "Sorry you lost"

# print "my secret was :", + secret

#

#if tipp == secret:

# print "Congratulation you won"

Oh no guys it is not working

Can someone say me how to make a screenshot please so I can show the code to you

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines