📜 New level grammars
This PR leans on #5963 but updates the grammars
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!
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.
- Do we want to keep supporting random like this?
fruit = ['apple', 'banana', 'cherry']
{print} fruit[random] <---- ERROR HERE
- 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!
- 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
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.
- Do we want to keep supporting random like this?
fruit = ['apple', 'banana', 'cherry'] {print} fruit[random] <---- ERROR HERE
- 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.
@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?
@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.
Made a to do list for next week (for myself) in: https://github.com/hedyorg/hedy/issues/6391#issuecomment-3236860781