Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 23 commits into from
May 9, 2024

Conversation

juliabolt
Copy link
Collaborator

@juliabolt juliabolt commented May 3, 2024

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:

  • change the feature flag in debugging.ts called showRoles to true
  • check that the variable list now shows roles of variables, in addition to the variable names and their values. (when using the Hedy debugger)
  • run this example program in level 2 and see if it says naam is a constant
naam is Hedy
leeftijd is 10
leeftijd is 15
print naam is leeftijd jaar oud
  • see if in level 2 the variables in this program are input constants
naam is ask Wat is je naam?
print Hoi naam
leeftijd is ask Hoe oud ben je?
print naam is leeftijd jaar oud
  • run this example program in level 10 and see if it says that dier is a walker
dieren = hond, kat, papegaai
voor dier in dieren
  print dier ' is een leuk dier!'
  • go to level 3 and see if dieren is a container in this example code
dieren is hond, kat, papegaai
print dieren at random
  • change the feature flag back to false
  • check that the variable list now looks like it normally does, with only the variable names and their values.

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

  • [x ] Contains one of the PR categories in the name
  • [x ] Describes changes in the format above
  • Links to an existing issue or discussion
  • [x ] Has a "How to test" section

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

@Felienne Felienne mentioned this pull request May 3, 2024
@juliabolt juliabolt marked this pull request as ready for review May 3, 2024 11:48
@juliabolt
Copy link
Collaborator Author

juliabolt commented May 4, 2024

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
Copy link
Collaborator Author

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

@jpelay
Copy link
Member

jpelay commented May 7, 2024

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@juliabolt
Copy link
Collaborator Author

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

@jpelay
Copy link
Member

jpelay commented May 8, 2024

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
Copy link
Member

jpelay commented May 8, 2024

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!

@Felienne Felienne changed the title 💻 constant and walker - roles of variables 💻 show some roles of variables (constant, input constant, walker, container) May 8, 2024
Copy link
Member

@Felienne Felienne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done @juliabolt and thanks for the help @jpelay!!

Copy link
Contributor

mergify bot commented May 8, 2024

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).

Copy link
Contributor

mergify bot commented May 9, 2024

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 mergify bot merged commit ece85e9 into main May 9, 2024
12 checks passed
@mergify mergify bot deleted the roles-of-variables branch May 9, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants