hedy icon indicating copy to clipboard operation
hedy copied to clipboard

📜 New level grammars

Open Felienne opened this issue 7 months ago • 6 comments

This PR leans on #5963 but updates the grammars

Felienne avatar May 16 '25 08:05 Felienne

Note to self on the progress here, step 1 is to duplicate level 5 into 6, done that for now by increasing all levels and simply copy 6 (the grammas then can be empty because it just merges in)

TODO Level 5

  • [ ] make 5 stricter

Level 6

  • [ ] Add elif, in and not in
  • [ ] From level 6 on, if and else each should be on their own line
  • [ ] Rewrite all level 6 tests with number converter

Level 7

  • [ ] Allow decimals

Level 9

  • [ ] Update tree traversal level 9 with and and or

Level 12

  • [x] Level 12 remove weird string things
  • [ ] Two remaining level 12 type tests that fail (now commented out)

Level 13+

  • [ ] Add optional colon in ifs in level 13+
  • [ ] for loop in traversal is still on level 11. Works but it not very pretty! Should be moved to 13
  • [ ] add booleans

General

  • [ ] Re-enable public programs tester
  • [ ] Remove the keyword {to} everywhere, no longer needed!

Felienne avatar May 16 '25 13:05 Felienne

I am down to only a few failing tests left on the new adventures @MarleenGilsing and @AnneliesVlaar.

There are a few open questions for you on how/whether we want to support it. I have not yet implemented them, but I easily could. I will keep a list here of open questions.

  1. Do we want to keep supporting random like this?
fruit = ['apple', 'banana', 'cherry']
{print} fruit[random] <---- ERROR HERE
  1. What style do we want to use in examples? Python or simpler? I have now used simple ones, for example:
for i in range 1, 3
    print i
print 'early in the morning'

But maybe we prefer for i in range(1, 3):? That also works, feel free to rewrite the examples how you want!

Felienne avatar Jun 15 '25 17:06 Felienne

  1. Do we want to keep supporting random like this?

No. We want to go to the Python way in level 13 (and explain it in level 14) using random.choice(list). But without the need for the users to import random. This then is very much in line with how we would like to change at random in the lower levels (level 3 till level 14): random choice list see #6173

AnneliesVlaar avatar Jun 16 '25 14:06 AnneliesVlaar

I am down to only a few failing tests left on the new adventures @MarleenGilsing and @AnneliesVlaar.

There are a few open questions for you on how/whether we want to support it. I have not yet implemented them, but I easily could. I will keep a list here of open questions.

  1. Do we want to keep supporting random like this?
fruit = ['apple', 'banana', 'cherry']
{print} fruit[random] <---- ERROR HERE
  1. What style do we want to use in examples? Python or simpler? I have now used simple ones, for example:
for i in range 1, 3
    print i
print 'early in the morning'

But maybe we prefer for i in range(1, 3):? That also works, feel free to rewrite the examples how you want!

Yes indeed @MarleenGilsing and I thought the same. Show the good example and be soepel when it is not fully correct.

AnneliesVlaar avatar Jun 16 '25 14:06 AnneliesVlaar

@Felienne If I want to make more changes, for example move the slides and workbooks to the correct levels. Should i work on this PR, keep working on this one https://github.com/hedyorg/hedy/pull/6263, or is it best to open a new one?

MarleenGilsing avatar Jun 19 '25 18:06 MarleenGilsing

@Felienne If I want to make more changes, for example move the slides and workbooks to the correct levels. Should i work on this PR, keep working on this one #6263, or is it best to open a new one?

Ha @MarleenGilsing!

You can keep working on 'your' PR, I can merge your into mine. That is easier for reading the changes later.

Felienne avatar Jun 20 '25 04:06 Felienne

Made a to do list for next week (for myself) in: https://github.com/hedyorg/hedy/issues/6391#issuecomment-3236860781

MarleenGilsing avatar Aug 29 '25 14:08 MarleenGilsing