hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.27k stars 282 forks source link

💻 show some roles of variables (constant, input constant, walker, container) #5500

Closed juliabolt closed 1 month ago

juliabolt commented 2 months ago

Adds roles in the variable list, works for four roles now, constant, input constant, container and walker.

How to test

Follow these steps to verify this PR works as intended:

Checklist Done? Check if you have it all in place using this list: (mark with x if done)

If you're unsure about any of these, don't hesitate to ask. We're here to help!

juliabolt commented 1 month ago

image image

When testing the code with the additions in this PR, everything seems to work in level 1 to 5, but from level 6 on, random things seem not to work, like calculations in level 6 and the repeat command in level 7. This already seems to go wrong, before ever getting to the function determine_roles that I added in hedy.py (when using the debugger and putting a breakpoint in that function). This happens no matter if the feature flag is false or true.

juliabolt commented 1 month ago

Issue in former comment is solved! thanks @jpelay :)

jpelay commented 1 month ago

I fixed the parsing problem! But now it's not showing output when in some programs, for example this one of level 12:

a is 2
b is 3
for a in range 2 to 4
    a is a + 2
    b is b + 2

There's a response and the program is shown as executed, perhaps it has to do with the fact that the variables has a type of unknown?

image

juliabolt commented 1 month ago

The type unknown should not work any differently than the other types, it's just a string in a dictionary...

I still get issues trying to test this code, ModuleNotFoundError: iso639 (see app.py line 22)

juliabolt commented 1 month ago

image I get this when I try your example code in Hedy level 12

juliabolt commented 1 month ago

I don't get that error in alpha, but it is normal that there is no output in that program :P

jpelay commented 1 month ago

I don't get that error in alpha, but it is normal that there is no output in that program :P

HAHA you're right! oops

jpelay commented 1 month ago

The type unknown should not work any differently than the other types, it's just a string in a dictionary...

I still get issues trying to test this code, ModuleNotFoundError: iso639 (see app.py line 22)

Do the pip thing again!

mergify[bot] commented 1 month ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

mergify[bot] commented 1 month ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).