[Tutor] Project help

2012-10-12 Thread Brett Dailey
I'm working on a few projects and need some help. Here's what the first one 
needs to do:

Credits
1. Create a list of strings. Make sure your program will work with any number 
of strings.
2. Make this text appear at the bottom of the screen and “crawl” to the top. 
The crawl should be at a slow
 speed (~20 pixels/s) and should run at the same rate on any computer.
3. It should fade from black (near the bottom) to white, and then back to black 
(at the top). 
4. The program should end when the user pressed escape or hits the “Quit-box”


Here's the second one:

Paint Program
1. Display a canvas inset from the main screen. 
2. Display a palette at the bottom. Allow the user to adjust the RGB current 
color. 
3. Use the mouse scroll-wheel to adjust the brush size. 
4. If the user clicks within the canvas area, draw with the current brush 
color/size 
5. If the user presses “s” save (just the) canvas to a file (“output.jpg”) 
6. Bonus: include “stamps” (sprites) that can be dragged onto the canvas.

Any help would be greatly appreciated!! These have been giving me some trouble. 
Also, if you can show me some of the code that would be great!

Thank you!!___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] More help

2012-10-12 Thread Brett Dailey
Here's another project I'm working on.

1. Create a random signal (600 random numbers in the range -50 to +50). 
Display it as shown below. 
2. Create a filter variable (integer) which is allowed to go from 0 to 
infinity. Allow the user to change this
with the up/down arrow keys. The user should have to release the key and press 
it again to go up /
down one level. 
3. Apply a box filter to the original signal.
 If filter is 0, the signal should be the same as the original 
 If filter is 1, you should, for each signal element i (of the new 
signal), average the i-1, i, and i+1
 elements of the original signal. 
 If filter is 2, you should, for each signal element i (of the new 
signal), average the i-2, i-1, i, i+1,
 and i+2 elements of the original signal iv. ...
 Note: if the i-? or i+? element is out of bounds, don't include it. 
For example, if filter is 1, and you are calculating the 0th   
element of the new signal, you should only average the 0th and 1th element of 
the original signal.

Thank you ahead of time!___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Help

2012-09-20 Thread Brett Dailey
I'm having trouble with a small project. Here's what it needs to do:Has variables for window width and window height and creates a window of that size.Has variables which control the number of columns and number of rows.From this, create a checkboard pattern which evenly fills the window. On approximately 10% of the squares (chosen at random) draw an image which is sized to just fit inside a checkboard square (use the smallest dimension).Keep the program open for 3 seconds and then quit.I've attached the code I have so far."Pic" is just a place holder for an actual image.Not sure what to do with the while statements that are empty in the code.Thanks for the help,Brett# Lab 3: Game Board
import pygame
import time


pygame.display.init()

WinH = 600
WinW = 800
num_rows = 8
num_cols = 12

screen = pygame.display.set_mode((WinW,WinH))

screen.fill((128,128,128))

markSurf = pygame.image.load(#Pic)
color = (0,0,0)
cell_width = WinW/num_cols
cell_height = WinH/num_rows

while #...
while #...
pygame.draw.rect(screen, color, (cell_width,cell_height), 0)
if color == (0,0,0):
color = (0,255,0)
else:
color = (0,0,0)

curRow = 0
while curRow  #:
if curRow %2 = 0:
color = (0,0,0)
else:
color = (0,255,0)
curRow +=1



pygame.display.update()
time.sleep(3)

pygame.display.quit()
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor