Gravitation wrote:
Also, I don't think that the cue is necessary; we'll see later.
I think you mean queue.
cue — a thing said or done that serves as a signal to an actor or other performer to enter or to begin their speech or performance.
queue (2) — [Computing] a list of data items, commands, etc., stored so as to be retrievable in a definite order, usually the order of insertion.
(both from the OAD)
Offline
nXIII wrote:
Gravitation wrote:
Also, I don't think that the cue is necessary; we'll see later.
I think you mean queue.
cue — a thing said or done that serves as a signal to an actor or other performer to enter or to begin their speech or performance.
queue (2) — [Computing] a list of data items, commands, etc., stored so as to be retrievable in a definite order, usually the order of insertion.
(both from the OAD)
*facepalm*
Thanks, but yeah, it'll probably be removed anyway.
Offline
technoboy10 wrote:
Gravitation wrote:
technoboy10 wrote:
Here's a list of names I've come up with:
CherryPy
ICanHazPy
EasyAsPy
(800th post!)EasyAsPy really rings a bell... it'll be easy to remember and is descriptive of our program. Let's go for that one.
![]()
Cool.
Yeah, the actual pies seemed a little seasonal.
Have you done any blocks yet? I want to test my simulator.
Offline
Gravitation wrote:
technoboy10 wrote:
Gravitation wrote:
EasyAsPy really rings a bell... it'll be easy to remember and is descriptive of our program. Let's go for that one.![]()
Cool.
Yeah, the actual pies seemed a little seasonal.
![]()
Have you done any blocks yet? I want to test my simulator.
I've done a couple, I'll try and post the updates later.
Offline
technoboy10 wrote:
Gravitation wrote:
technoboy10 wrote:
Cool.
Yeah, the actual pies seemed a little seasonal.
![]()
Have you done any blocks yet? I want to test my simulator.I've done a couple, I'll try and post the updates later.
Yay
I haven't done any, I feel so guilty ;_;
Offline
Done. The first post has the code that I have so far. You'll have to download scratch.py first, though. (http://wiki.scratch.mit.edu/wiki/Python)
Offline
I'm getting a weird error when running this...
Sprites = []
Scripts = []
Blocks = []
class Sprite():
global Sprites, Scripts
def __init__():
self.x = 0
self.y = 0
self.dir = 90
self.hidden = False
self.myScripts = []
self.name = "Sprite1"
class Script():
global Sprites, Scripts, Blocks
def __init__(self):
global Sprites
self.id = 0
self.myBlocks = []
self.pos = 0
self.owner = 0
k = 0
for i in Sprites:
for j in i.myScripts:
if j.id == self.id:
self.owner = k
k += 1
class Block():
global Scripts, Blocks
def __init__(self):
global Scripts
self.id = 0
self.block = 0
self.inputs = []
self.complete = False
self.running = False
k = 0
for i in Scripts:
for j in i.myBlocks:
if j.id == self.id:
self.owner = k
k += 1
def check(self):
global Scripts
if self.running == False:
Scripts[self.owner].pos += 1
if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks):
Scripts[self.owner].pos = -1
def run(self):
global Sprites, answer
for i in range(len(self.inputs)):
if type(self.inputs[i]) == type(Sprites[0]):
self.inputs[i] = self.inputs[i].run()
if self.block == 0: #say
string = str(self.inputs[0])
print(string)
if self.block == 1: #ask
string = str(self.inputs[0])
answer = raw_input(string)
from math import sqrt
if self.block == 2: #join
a = str(self.inputs[0])
b = str(self.inputs[1])
return a + b
if self.block == 3: #mod
return self.inputs[0] % self.inputs[1]
if self.block == 4: #letter of
string = str(self.inputs[1])
num = (self.inputs[0] - 1) % len(string)
return string[num]
if self.block == 5: #length of
string = str(self.inputs[0])
return len(string)Still doesn't work (I'm working on it) but I ran it just to check it's syntax. Now I get an unexpected indentation error.
Offline
Gravitation wrote:
I'm getting a weird error when running this...
Code:
Sprites = [] Scripts = [] Blocks = [] class Sprite(): global Sprites, Scripts def __init__(): self.x = 0 self.y = 0 self.dir = 90 self.hidden = False self.myScripts = [] self.name = "Sprite1" class Script(): global Sprites, Scripts, Blocks def __init__(self): global Sprites self.id = 0 self.myBlocks = [] self.pos = 0 self.owner = 0 k = 0 for i in Sprites: for j in i.myScripts: if j.id == self.id: self.owner = k k += 1 class Block(): global Scripts, Blocks def __init__(self): global Scripts self.id = 0 self.block = 0 self.inputs = [] self.complete = False self.running = False k = 0 for i in Scripts: for j in i.myBlocks: if j.id == self.id: self.owner = k k += 1 def check(self): global Scripts if self.running == False: Scripts[self.owner].pos += 1 if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks): Scripts[self.owner].pos = -1 def run(self): global Sprites, answer for i in range(len(self.inputs)): if type(self.inputs[i]) == type(Sprites[0]): self.inputs[i] = self.inputs[i].run() if self.block == 0: #say string = str(self.inputs[0]) print(string) if self.block == 1: #ask string = str(self.inputs[0]) answer = raw_input(string) from math import sqrt if self.block == 2: #join a = str(self.inputs[0]) b = str(self.inputs[1]) return a + b if self.block == 3: #mod return self.inputs[0] % self.inputs[1] if self.block == 4: #letter of string = str(self.inputs[1]) num = (self.inputs[0] - 1) % len(string) return string[num] if self.block == 5: #length of string = str(self.inputs[0]) return len(string)Still doesn't work (I'm working on it) but I ran it just to check it's syntax. Now I get an unexpected indentation error.
Hmm... I'll take a look when I get to a normal computer.
Offline
technoboy10 wrote:
Odd, I ran it just fine on my computer (as a module).
![]()
It must have been a parser error. What version of Python are you running it in?
Offline
Gravitation wrote:
technoboy10 wrote:
Odd, I ran it just fine on my computer (as a module).
![]()
![]()
It must have been a parser error. What version of Python are you running it in?
Python 2.7.3.
Offline
technoboy10 wrote:
Gravitation wrote:
technoboy10 wrote:
Odd, I ran it just fine on my computer (as a module).
![]()
![]()
It must have been a parser error. What version of Python are you running it in?Python 2.7.3.
Ah, I'm running 3.3.0.
I'll try my 2.7 copy.
Offline
Gravitation wrote:
technoboy10 wrote:
Gravitation wrote:
![]()
It must have been a parser error. What version of Python are you running it in?Python 2.7.3.
Ah, I'm running 3.3.0.
I'll try my 2.7 copy.![]()
Yeah, Python 3 isn't my favorite, mainly because they got rid of raw_input().
Offline
technoboy10 wrote:
Gravitation wrote:
technoboy10 wrote:
Python 2.7.3.Ah, I'm running 3.3.0.
I'll try my 2.7 copy.![]()
Yeah, Python 3 isn't my favorite, mainly because they got rid of raw_input().
They did? :oooo
It's still throwing that error, though.
Anyway, I did like, 5 minutes of work on the code:
Sprites = []
Scripts = []
Blocks = []
class Sprite():
global Sprites, Scripts
def __init__(self):
self.x = 0
self.y = 0
self.dir = 90
self.hidden = False
self.myScripts = []
self.name = "Sprite1"
def run(self):
for i in self.myScripts:
i.run()
class Script():
global Sprites, Scripts, Blocks
def __init__(self):
global Sprites
self.id = 0
self.loops = []
self.myBlocks = []
self.pos = 0
self.owner = 0
k = 0
for i in Sprites:
for j in i.myScripts:
if j.id == self.id:
self.owner = k
k += 1
def run(self):
if self.pos == -1:
if self.loops[len(self.loops) - 1][2] == len(self.myBlocks):
self.pos = self.loops[len(self.loops) - 1][1]
else:
if self.myBlocks[0].run() == True:
self.pos == 0
if self.pos == 0 and self.myBlocks[0].run() == True:
self.pos = 1
self.myBlocks[pos].run()
class Block():
global Scripts, Blocks
def __init__(self):
global Scripts
self.id = 0
self.block = 0
self.inputs = []
self.complete = False
self.running = False
k = 0
for i in Scripts:
for j in i.myBlocks:
if j.id == self.id:
self.owner = k
k += 1
def check(self):
global Scripts
if self.running == False:
Scripts[self.owner].pos += 1
if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks):
Scripts[self.owner].pos = -1
def run(self):
global Sprites, answer
for i in range(len(self.inputs)):
if type(self.inputs[i]) == type(Sprites[0]):
self.inputs[i] = self.inputs[i].run()
if self.block == 0: #say
string = str(self.inputs[0])
print(string)
if self.block == 1: #ask
string = str(self.inputs[0])
answer = raw_input(string)
from math import sqrt
if self.block == 2: #join
a = str(self.inputs[0])
b = str(self.inputs[1])
return a + b
if self.block == 3: #mod
return self.inputs[0] % self.inputs[1]
if self.block == 4: #letter of
string = str(self.inputs[1])
num = (self.inputs[0] - 1) % len(string)
return string[num]
if self.block == 5: #length of
string = str(self.inputs[0])
return len(string)Can you check it, please?
Now we must finish the block definitions and set up Pygame! Our emulator then works; the conversion will be our next target.
You knew that already, though. ;P
Offline
Gravitation wrote:
technoboy10 wrote:
Yeah, Python 3 isn't my favorite, mainly because they got rid of raw_input().
They did? :oooo
It's been renamed input().
Offline
blob8108 wrote:
Gravitation wrote:
technoboy10 wrote:
Yeah, Python 3 isn't my favorite, mainly because they got rid of raw_input().
They did? :oooo
It's been renamed input().
HORRIBLE
Offline
mythbusteranimator wrote:
blob8108 wrote:
Gravitation wrote:
They did? :ooooIt's been renamed input().
HORRIBLE
![]()
Why?
Offline
technoboy10 wrote:
@Gravitation I'm getting errors with indentation in the Script class.
Oh, I see that; my editor has a major space-tab bug, so indentation is a problem.
Sprites = []
Scripts = []
Blocks = []
class Sprite():
global Sprites, Scripts
def __init__(self):
self.x = 0
self.y = 0
self.dir = 90
self.hidden = False
self.myScripts = []
self.name = "Sprite1"
def run(self):
for i in self.myScripts:
i.run()
class Script():
global Sprites, Scripts, Blocks
def __init__(self):
global Sprites
self.id = 0
self.loops = []
self.myBlocks = []
self.pos = 0
self.owner = 0
k = 0
for i in Sprites:
for j in i.myScripts:
if j.id == self.id:
self.owner = k
k += 1
def run(self):
if self.pos == -1:
if self.loops[len(self.loops) - 1][2] == len(self.myBlocks):
self.pos = self.loops[len(self.loops) - 1][1]
else:
if self.myBlocks[0].run() == True:
self.pos == 0
if self.pos == 0 and self.myBlocks[0].run() == True:
self.pos = 1
self.myBlocks[pos].run()
class Block():
global Scripts, Blocks
def __init__(self):
global Scripts
self.id = 0
self.block = 0
self.inputs = []
self.complete = False
self.running = False
k = 0
for i in Scripts:
for j in i.myBlocks:
if j.id == self.id:
self.owner = k
k += 1
def check(self):
global Scripts
if self.running == False:
Scripts[self.owner].pos += 1
if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks):
Scripts[self.owner].pos = -1
def run(self):
global Sprites, answer
for i in range(len(self.inputs)):
if type(self.inputs[i]) == type(Sprites[0]):
self.inputs[i] = self.inputs[i].run()
if self.block == 0: #say
string = str(self.inputs[0])
print(string)
if self.block == 1: #ask
string = str(self.inputs[0])
answer = raw_input(string)
from math import sqrt
if self.block == 2: #join
a = str(self.inputs[0])
b = str(self.inputs[1])
return a + b
if self.block == 3: #mod
return self.inputs[0] % self.inputs[1]
if self.block == 4: #letter of
string = str(self.inputs[1])
num = (self.inputs[0] - 1) % len(string)
return string[num]
if self.block == 5: #length of
string = str(self.inputs[0])
return len(string)That should work.
Offline
Offline
@raw_input() in Python 3 Whoops, my bad. I thought they completely got rid of it.
Offline
@Gravitation What do you think about having a website for this project? I was thinking about reserving easyaspy.tk.
BTW, did you know we have a Scratch Wiki page?
Offline
The website is now up (sort of)! It redirects to the Scratch site ATM. http://www.easyaspy.tk
EDIT: The site has some basic content on it now. I'll work on it some more in coming days.
Last edited by technoboy10 (2012-12-09 19:40:10)
Offline
technoboy10 wrote:
@Gravitation What do you think about having a website for this project? I was thinking about reserving easyaspy.tk.
BTW, did you know we have a Scratch Wiki page?
Good idea!
And no, I did not know that! :3
technoboy10 wrote:
The website is now up (sort of)! It redirects to the Scratch site ATM. http://www.easyaspy.tk
EDIT: The site has some basic content on it now. I'll work on it some more in coming days.
Yaaay! Thanks!
pwiter wrote:
As a tip, you should use GitHub for this project.
Okay, we'll try it out.
@Magnie I know you mentioned that because of indentation; it's because Notepad++ replaces tabs with 4 spaces, and Notepad doesn't, and I mix them. Afterwards I forget to replace the tabs with 4 spaces, so I get indentation issues.
Thanks for posting that!
Offline