jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

def draw no loop with random #194

Closed unoudos closed 6 years ago

unoudos commented 6 years ago

import random as ra x = 0 y = 0 salto = 10 def setup(): size(400,400) background(0) stroke(255)

def draw(): if ra.randint(0, 1) <= .5: line(x, y, x + salto, y + salto) else: line(x, y + salto, x + salto, y) x = x + salto

print "hola"

print frameCount

don't loop

villares commented 6 years ago

Hi @unoudos,

I have added some indentation and a global x statement. I seems to work fine for me.

screen shot 2017-09-30 at 8 07 35 pm

unoudos commented 6 years ago

correct global x work good thanx but don't use framerate(5) slows down the screen printing