Discuss Scratch

racheldragon
Scratcher
7 posts

Python

I have just started Python so I can't make much. I am working on a ‘talk to the computer’ game and a guessing game. Ideas for programs at this level would be great.

racheldragon

Dragons, poetry, computers, writing, science…
I love quirky and creative. Star sign: Libra. Hogwarts house: Ravenclaw.
WooHooBoy
Scratcher
1000+ posts

Python

racheldragon wrote:

I have just started Python so I can't make much. I am working on a ‘talk to the computer’ game and a guessing game. Ideas for programs at this level would be great.
Do exactly what you're doing now. Maybe then look into file management.

considered harmful
DatOneLefty
Scratcher
1000+ posts

Python

It never happened

Last edited by DatOneLefty (May 31, 2019 15:25:04)



Joke of the Nanosecond

Posts: bf97b44a7fbd33db070f6ade2b7dc549 (btw i use arch)

technoguyx
Scratcher
500+ posts

Python

I don't know what you mean by “pythonlike scratch” but this online platform lets you take a short course on Python 3 and run your own simple programs, entirely online.

If you download the Windows version of Python, it comes with a GUI console where you can easily write and run programs, too.
LucyMary11
Scratcher
13 posts

Python

Hi I started to use Python after I joined Scratch, because I have a coding book with introductions to both languages in it.
I found Python harder than Scratch, but I still made a Ghost Game on it.
I made this on IDLE, not the actual Python.
This is the code that I used:

# Ghost Game
from random import randint
print ( ‘Ghost Game’ )
feeling_brave = True
score = 0
while feeling_brave:
ghost_door = randint (1, 3)
print ( ‘Three doors ahead…’ )
print ( ‘Ghost behind one.’ )
print ( ‘Which door do you open?’ )
door = input ( ‘1, 2, or 3?’ )
door_num = int ( door )
if door_num == ghost_door:
print ( ‘GHOST!’ )
feeling_brave = False
else:
print ( ‘No ghost!’ )
print ('You enter the next room' )
score = score + 1
print ( ‘Run away!’ )
print ( ‘Game over! You scored’ , score)


To play the game, just type the numbers 1,2 or 3.
It is a game of luck not strategy.
It is a guessing game.
All credit for this goes to my coding book
But I wanted to share it because it is very fun and simple to play.
Enjoy

LucyMary11
soclove
Scratcher
17 posts

Python

powercon5 wrote:

try https://www.codecademy.com/
You know, codeacademy actually teaches Python wrong. They say when you want the computer to print something, you do
print“Hello world”
But you actually have to put parentheses.
I'm trying to learn Python too so I'm looking for something.
Python for Kids is okay. It's a book.

You have just talked to living swagnemite.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░░░░░░░░░
░░░░░░░░▄▀░░░░░░░░░░░░▄░░░░░░░▀▄░░░░░░░
░░░░░░░░█░░▄░░░░▄░░░░░░░░░░░░░░█░░░░░░░
░░░░░░░░█░░░░░░░░░░░░▄█▄▄░░▄░░░█░▄▄▄░░░
░▄▄▄▄▄░░█░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██░░
░██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██░░
░░▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██░
░░░░▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██░
░░░░░░░▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██░
░░░░░░░▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀░░
░░░░░░█▀▀█████████▀▀▀▀████████████▀░░░░
░░░░░░████▀░░███▀░░░░░░▀███░░▀██▀░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Go here to see mur blog!
nathanprocks
Scratcher
1000+ posts

Python

soclove wrote:

powercon5 wrote:

try https://www.codecademy.com/
You know, codeacademy actually teaches Python wrong. They say when you want the computer to print something, you do
print“Hello world”
But you actually have to put parentheses.
I'm trying to learn Python too so I'm looking for something.
Python for Kids is okay. It's a book.
Codecademy uses Python 2.7.3. You're using Python 3.x, which has some different syntax.


Want to write text in rainbow? How about uʍop-ǝpısdn? Or just sdrawkcab? Get the TextTools Chrome extension!
My browser / operating system: Macrosoft Winding XO, Internet Exploder 6.0, Angel Player ver.:1.2.5
;
DatOneLefty
Scratcher
1000+ posts

Python

i know a good amount of python. does codeacademy have a filter? because if not, people can crawl everything and use a script to delete it


Joke of the Nanosecond

Posts: bf97b44a7fbd33db070f6ade2b7dc549 (btw i use arch)

thereare21
Scratcher
8 posts

Python

-sigh- code academy… I went through it and learned some python, but after that it just said i had to pay in order to continue… so i quit.
SC_DStwo_Master
Scratcher
100+ posts

Python

thereare21 wrote:

-sigh- code academy… I went through it and learned some python, but after that it just said i had to pay in order to continue… so i quit.
nice necrobump
yzscratcher
Scratcher
100+ posts

Python

I've already done many awesome games with Python and Pygame. Pygame is a modification for Python to make games. It's pretty easy to make programs there, but you need to know Math very good, if you want to make great projects. I normally do copies of famous games and my best projects where I worked hard about were: Minecraft 2D with map save and skins, Tetris with Highscoretable and awesome design AND I'm making a game like Clash of Clans. I would advise sb. to start with small projects like Tic Tac Toe or something like it.


yzscratcher
Scratcher
100+ posts

Python

soclove wrote:

powercon5 wrote:

try https://www.codecademy.com/
You know, codeacademy actually teaches Python wrong. They say when you want the computer to print something, you do
print“Hello world”
But you actually have to put parentheses.
I'm trying to learn Python too so I'm looking for something.
Python for Kids is okay. It's a book.
I've learned it with the book RPi for Kids and I can program with Python very good now.
I like the …for Kids series very much, because there is all explained.


marscratcher
Scratcher
100+ posts

Python

I have started learning python recently! I have been mostly experimenting with tkinter.

Marscratcher
marscratcher
Scratcher
100+ posts

Python

Here's a little jump the spikes game I made in python! Try it out in your python processor if you have one, just up arrow to jump.

from tkinter import*
import time

class Ground:
def __init__(self, canvas):
self.canvas = canvas
self.id = canvas.create_rectangle(0, 0, 1200, 100, fill = 'black')
self.canvas.move(self.id, 0, 200)

class Player:
def __init__(self, canvas):
self.canvas = canvas
self.id = canvas.create_rectangle(0, 0, 50, 50, fill = 'black')
self.canvas.move(self.id, 100, 150)
self.Yvel = 0
self.canvas.bind_all('<KeyPress-Up>', self.jump)
self.pos = self.canvas.coords(self.id)
self.alive = True
def draw(self):
self.canvas.move(self.id, 0, self.Yvel)
self.pos = self.canvas.coords(self.id)
if self.pos[3] < 200 :
self.Yvel = self.Yvel + 0.1
else:
self.Yvel = 0
self.canvas.move(self.id, 0, 200 - self.pos[3])
if self.pos[0] < spike.pos[4] and self.pos[0] > spike.pos[0] or self.pos[2] < spike.pos[4] and self.pos[2] > spike.pos[0]:
if self.pos[3] > spike.pos[3] :
self.alive = False
def jump(self, evt):
pos = self.canvas.coords(self.id)
if pos[3] == 200 :
self.Yvel = -5

class Spike:
def __init__(self, canvas):
self.canvas = canvas
self.id = canvas.create_polygon(0, 50, 20, 0, 40, 50)
self.canvas.move(self.id, 1160, 150)
self.speed = 2
self.pos = self.canvas.coords(self.id)
def draw(self):
self.canvas.move(self.id, self.speed * -1, 0)
self.pos = self.canvas.coords(self.id)
if self.pos[0] < 0 :
self.canvas.move(self.id, 1160 +(0 - self.pos[0]), 0)
self.pos = self.canvas.coords(self.id)
if self.speed < 10 :
self.speed = self.speed + 1

tk = Tk()
tk.title("Spike Jump")
tk.resizable(0, 0)
tk.wm_attributes("-topmost", 1)
canvas = Canvas(tk, width = 1200, height = 300, bd = 0, highlightthickness = 0)
canvas.pack()
tk.update()

player = Player(canvas)
spike = Spike(canvas)
ground = Ground(canvas)

while True:
player.draw()
spike.draw()
if not player.alive :
time.sleep(3)
break
tk.update_idletasks()
tk.update()
time.sleep(0.01)

Marscratcher
JonathanSchaffer
Scratcher
1000+ posts

Python

i made a jukebox program for .wav files
from pygame import mixer
import os
mixer.init()
print("list of music:")
for file in(os.listdir("link to music folder")):
    if(file.endswith(".wav")):
        print(file[:-4])
song = mixer.Sound("/home/pi/Music/" + input("which song would you like to play? ") + ".wav")
c = mixer.Channel(1)
c.play(song)
works with python 3

Last edited by JonathanSchaffer (April 3, 2018 13:02:52)


do you like siri, alexa, cortana, or google assistant, but can't buy an iphone, echo, or google home?

then try alice!

alice is a wonderful virtual assistant that works on linux and is tested on raspberry pi*
she can play music, search online, answer questions, tell jokes, give you the date and time, and plenty of other things

*you may need to install additional software like python 2, libttspico-utils, and timidity
asqwde
Scratcher
1000+ posts

Python

Pyhton can be advanced as well
Wimim
Scratcher
24 posts

Python

Try datacamp.com
Code Academy is using Python 2 (Which is too old, now it's Python 3)

Or if you live in Sweden there are many great courses in the capital of Sweden, Stockholm. I should actually go in a curse in Stockholm later in February.

Last edited by Wimim (Feb. 13, 2018 20:28:03)


Wimim
marscratcher
Scratcher
100+ posts

Python

racheldragon wrote:

I have just started Python so I can't make much. I am working on a ‘talk to the computer’ game and a guessing game. Ideas for programs at this level would be great.
Try messing around with tkinter. It's not too hard, and you can do some cool simple graphical games with it.

Marscratcher
JonathanSchaffer
Scratcher
1000+ posts

Python

virtual assistant for python 2 on Linux named Alice
moved to github

Last edited by JonathanSchaffer (Sept. 21, 2019 11:14:53)


do you like siri, alexa, cortana, or google assistant, but can't buy an iphone, echo, or google home?

then try alice!

alice is a wonderful virtual assistant that works on linux and is tested on raspberry pi*
she can play music, search online, answer questions, tell jokes, give you the date and time, and plenty of other things

*you may need to install additional software like python 2, libttspico-utils, and timidity
JonathanSchaffer
Scratcher
1000+ posts

Python

LucyMary11 wrote:

Hi I started to use Python after I joined Scratch, because I have a coding book with introductions to both languages in it.
I found Python harder than Scratch, but I still made a Ghost Game on it.
I made this on IDLE, not the actual Python.
This is the code that I used:

# Ghost Game
from random import randint
print ( ‘Ghost Game’ )
feeling_brave = True
score = 0
while feeling_brave:
ghost_door = randint (1, 3)
print ( ‘Three doors ahead…’ )
print ( ‘Ghost behind one.’ )
print ( ‘Which door do you open?’ )
door = input ( ‘1, 2, or 3?’ )
door_num = int ( door )
if door_num == ghost_door:
print ( ‘GHOST!’ )
feeling_brave = False
else:
print ( ‘No ghost!’ )
print ('You enter the next room' )
score = score + 1
print ( ‘Run away!’ )
print ( ‘Game over! You scored’ , score)


To play the game, just type the numbers 1,2 or 3.
It is a game of luck not strategy.
It is a guessing game.
All credit for this goes to my coding book
But I wanted to share it because it is very fun and simple to play.
Enjoy
You can replace
score = score + 1
with
score += 1

do you like siri, alexa, cortana, or google assistant, but can't buy an iphone, echo, or google home?

then try alice!

alice is a wonderful virtual assistant that works on linux and is tested on raspberry pi*
she can play music, search online, answer questions, tell jokes, give you the date and time, and plenty of other things

*you may need to install additional software like python 2, libttspico-utils, and timidity

Powered by DjangoBB

Standard | Mobile