Use this thread to discuss your questions and comments about how to run the lesson.
I’m having some issues here with all of the nested if loops, but I’ll start with one question:
If I have the program checking to see if userInput.includes(“g”), that will always fire true before it checks userInput.includes(“pg”)…
…wait, should I set it to userInput.includes(" g ")?
Well, I think that works unless a lazy user types “G comedy please?”, in which case it ignores the rating. I tried switching it to userInput.includes("g "), but that opens up same PG problem as before.
Any thoughts? Thanks in advance!
Yes the best bet is to go with " g " as that will catch the majority of the cases you are looking for without getting confused with pg. Its definitely not the perfect algorithm but it helps expose the complexities of natural language processing.
TYPO POLICE ARE HERE AGAIN. I think they’re making too much of a game out of it at this point.
Puzzle 8, full directions, Hint paragraph, second sentence – uses the word “are” twice.
Puzzle 6, instructions recap – “instructions” is spelled incorrectly on the bottom line.
(Dani (or whoever), if there’s a better way to do this than filling up the message board, please let me know. Thanks!)
Thanks for passing these along - posting them here is fine.
I updated the levels and they should be live in the next couple days.
Students are making the following type of error. userInput.includes(“who” || “what” || “where”).
Maybe the directions could help a bit more with the syntax for combining includes and OR.
This might be a good place to talk a bit about testing. Students could use some guidance on how to test and what the expected output should be.
We are having a lot of trouble with block mode. When scrolling its really easy to end up pulling blocks out of the super long if statement about a question.
Most of the students have switched to text mode. But the syntax highlighting and tabing is not that good and its very hard for students to balance their parens and brackets.
This is being a painful chunk to teach.
As I mentioned at PD it would be great to have more details about the Chromebooks that this is happening on. What type of chromebooks are they?
In terms of the text mode stuff: I’m sorry its been a tough section of lessons. It is probably good that students are starting to use text mode as the ultimate goal is to move them toward text based programming. However it can definitely be tricky so syntax highlighting and tabing are good suggestions for the future. A way to get around issues with matching parens and brackets for now is to pull out blocks to create the structure of the program (even while in text mode) and then change the details. Also this might be a good time to stop students and have a lesson about good coding practices such as indenting and white space.
Sorry last week was rough. Hopefully this one is better! It was great to see you this weekend.
I am having difficulty scrolling down to see the new logic flow chart of puzzle 7. For me, only the top of the flow chart is displayed. Does anyone else have this issue?
That actually is that way on purpose to save space and just highlight the change. The whole flowchart is not needed because the only updated spot is that first diamond in yellow. What would help make that clearer for others in the future?
I cannot figure out what the issues is with my last “else” statement. If anyone gets a chance to look at my code it would be much appreciated.
Never mind, I troubleshooted the issued.
Is the activity answer sheet correct? #7 and #8 on last page.
Those two are in fact correct but they’re a little tricky.
Make sure you keep track of the parentheses. The first two statements are both true so the AND between them will still evaluate to true. Even though the last statement is false only one of the two statements joined by an OR needs to be true to evaluate to TRUE.
The first statement is true. The second one says age + 5 > 20. Since age = 16, age + 5 is 21 which is in fact greater than 20. Therefore both statements are true so when combined by an AND the result is true.
If you want you can past those statements into a program with the assignment statements into a program to try them out yourself.
var age = 16;
var day = "Monday";
console.log(((age > 10) && ((age + 5) > 20)));
Let me know if that helps. Admittedly those are quite challenging and boolean logic can take a minute to get more comfortable with. Happy to provide more assistance if you need.