Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

DO MY HOMEWORK :DD EBIN

Name: Anonymous 2012-11-14 19:55

Hello /prog/,
I need your help. This is my program so far
import turtle
turtle.showturtle()
def turtle_interface():
    while True :
          n = 0
          instructions = input().split()
          i = instructions[0]
          if len(instructions) > 1:
              n = int(instructions[1])
              if i == 'forward' :
                  turtle.forward(n)
              elif i == 'backward' :
                  turtle.backward(n)
              elif i == 'left' :
                  turtle.left(n)
              elif i == 'right' :
                  turtle.right(n)
              elif i == 'quit' :
                  break
              elif i == 'new' :
                  turtle.reset()
              else :
                  continue
print('Control the turtle!')
turtle_interface()

As you can see, when the string has no [n] after it, it's being ignored. How can I fix this?

Name: Anonymous 2012-11-14 19:59

go to stackoverflow.com

don't post here. FOR THE LOVE OF GOD, LEAVE BEFORE THEY COME

Name: Anonymous 2012-11-14 20:03

instructions = input().split()
          i = instructions[0]
          if len(instructions) > 1:
              n = int(instructions[1])

With what can i replace this? basically i just need to be able to assign separate inputs in one line without using .split

Name: Anonymous 2012-11-14 20:03

HOLY COW!
A Blast from the Shart!

You should probably kill your teacher for trying to teach javakike. Do it while at school, in class.

Name: Anonymous 2012-11-14 20:04

>>2
yeah nah i only got 4 hours before my coursework deadline

i think this boards faster than that

Name: Anonymous 2012-11-14 20:07

don't you worry.

/frog/ will get to it immediately.

Name: Anonymous 2012-11-14 20:08

>>4
javakike
but that's FIOC
no, at least it's FIOC and not javashit

le stack overflow will help you with that, you even get le karma for making questions there!

Name: Anonymous 2012-11-14 20:15

>mfw i have no face when my program seems to be too complex even for expert programmers to handle

Name: Anonymous 2012-11-14 20:27

>>8
So you come from /g/. Go back there, cockfag.

Name: Anonymous 2012-11-14 20:38

>>9
LOL E/G/IN WIM GRO XDDD

Name: Anonymous 2012-11-14 20:40

>>9
HAHA are you angry, dude l:¬)

Name: Anonymous 2012-11-14 21:01

>>8
Is that even relevant to the topic or is this just your way of saying ``I haven't read SICP''? Impenetrable complexity is a consequence of very poor abstractions.

Name: Anonymous 2012-11-14 21:03

Terrible */

Name: Anonymous 2012-11-14 21:08

New thread subject: /prog/'s source code

Has anyone ever checked the HTML of this site? It's unindented and hard to read. I propose we rewrite the Shiit ``in Lisp''. We could write an API that uses S-expressions for data exchange (JSON is gay) and rewrite /prog/ ``in Lisp''.

Name: Anonymous 2012-11-14 21:09

>>14
I meant rewrite /prog/scrape, of course.

Name: Anonymous 2012-11-14 21:13

I hadn't seen a ``thread hijack'' in a long while.

Name: Anonymous 2012-11-14 21:19

>>14
So you're saying we'd have client side scripts that pull structured data from a server (serialized as sexps) and render it in presentable ways in an Emacs mode?

This is a good idea. I'll begin contributing immediately. The actual implementation of everything I write will be left as an exercise for the reader.

Name: Anonymous 2012-11-14 21:23

>>17
LOL LE E/G/IN WIN GRO XD

Name: Anonymous 2012-11-14 21:39

>>17
Emacs mode
Yeah, no.

Name: Anonymous 2012-11-14 22:39

>>19
No, yeah.

Name: Anonymous 2012-11-14 22:51

>>20
Emacs is written in C.

Name: Anonymous 2012-11-19 15:19

check 'em

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List