Coding Challenge #43: Context-Free Grammar

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=8Z9FRiW2Jlc



Duration: 18:53
29,253 views
385


In this Coding Challenge, I code a Context-Free Grammar text generator from scratch. The concept of recursion is explored. This video is part of Session 7 of the "Programming from A to Z" ITP class. Code: https://thecodingtrain.com/challenges/43-context-free-grammar

πŸ•ΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/_ll_PYXeg

πŸŽ₯ Previous video: https://youtu.be/eGFJ8vugIWA?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Next video: https://youtu.be/uw3GbsY_Pbc?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
🌟 Reading and Writing Electronic Text: https://github.com/aparrish/rwet-examples
🌈 Programming from A to Z: https://github.com/Programming-from-A-to-Z/A2Z-F16
πŸ“š Tracery: https://github.com/Programming-from-A-to-Z/A2Z-F16
πŸ“š RiTa: https://rednoise.org/rita/

Videos:
✏️ Homework Assignment for Context-Free Grammar Generation: https://youtu.be/UzVtOS2DBA8
πŸš‚ Tutorial playlist on Context-Free Grammar: https://youtube.com/playlist?list=PLRqwX-V7Uu6Y7iXZe_8XKJhaw_kRo8REO
πŸ”΄ Coding Train Live 65: https://youtu.be/X6IPcExkG30?t=7474s

Related Coding Challenges:
πŸš‚ #16 Fractal Trees - L-System: https://youtu.be/E1B4UoSQMFw
πŸš‚ #14 Recursive Fractal Trees: https://youtu.be/0jjeOYMjmDU
πŸš‚ #77 Recursion: https://youtu.be/jPsZwrV9ld0
πŸš‚ #39 Mad Libs Generator: https://youtu.be/ziBO-U2_t3k

Timestamps:
0:00 Introduction!
1:10 Defining a JavaScript object containing the grammar rules
3:44 Creating a recursive algorithm to generate a random sentence
11:51 Generating multiple random sentences
12:27 Creating a more intricate grammar structure using Allison Parish's examples
15:00 Summarizing and looking at other examples
18:20 Things you could do!

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

πŸš‚ Website: http://thecodingtrain.com/
πŸ‘Ύ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: https://github.com/CodingTrain
πŸ’¬ Discord: https://thecodingtrain.com/discord
πŸ’– Membership: http://youtube.com/thecodingtrain/join
πŸ›’ Store: https://standard.tv/codingtrain
πŸ–‹οΈ Twitter: https://twitter.com/thecodingtrain
πŸ“Έ Instagram: https://www.instagram.com/the.coding.train/

πŸŽ₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: https://p5js.org
πŸ”— p5.js Web Editor: https://editor.p5js.org/
πŸ”— Processing: https://processing.org

πŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#textgenerator #recursion #grammar #p5js #javascript







Tags:
context-free grammars
grammars
grammar
context-free grammar
programming
daniel shiffman
creative coding
p5.js
coding challenge
p5.js tutorial
p5js
javascript (programming language)
tutorial
javascript
algorithms
javascript string object
js string object
programming from a to z
programming challenge
regular expressions
text analysis
recursion
javascript context-free grammar
p5.js context-free grammar