Skip to content

Runestone Issue: Can't get stdin working in Activecode #1106

@tc-kirby

Description

@tc-kirby

Please check the current issues
Can't find anything containing 'stdin'

What Page were you on
https://runestone.academy/assignment/instructor/builder/255445/exercises/create/activecode

Describe the bug
I set up stdin for an exercise and wrote this program:

import sys
import turtle

t = turtle.Turtle()

# 1. Read the entire input buffer into a variable
raw_input = sys.stdin.read()

# 2. Check if raw_input exists and is not empty to avoid TypeErrors
if raw_input:
    # 3. Process the lines
    for line in raw_input.splitlines():
        for char in line.upper():
            if char == 'F':
                t.forward(20)
            elif char == 'B':
                t.backward(20)
            elif char == 'L':
                t.left(90)
            elif char == 'R':
                t.right(90)
            elif char == 'U':
                t.penup()
            elif char == 'D':
                t.pendown()

but I get:
ExternalError: TypeError: Cannot read properties of undefined (reading 'length') on line 7

A Screenshot is worth a thousand words
A video of you reproducing the problem is worth even more.

Image

Javascript Errors
Many many errors can be quickly diagnosed from the Javascript Console error log. On Chrome this is View --> Developer --> Javascript Console, on Safari ⌥⌘i or Develop --> Show Web Inspector on Firefox Tools --> Web Developer --> Toggle Tools. Please select all and paste it here. Don't try to guess what might be useful. This is perhaps the most useful thing you can do to help us track down a problem!!

Image

What is your username
tomkirby

If you do not take the time to fill in this template we will treat this as very low priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions