Making a calculator from scratch - #SoME3

VoxelRifts
VoxelRifts
29.9 هزار بار بازدید - پارسال - Disclaimer: This video is rather
Disclaimer: This video is rather programming heavy at points. You are welcome to skip these parts, but do note you might miss some small detail somewhere. These sections have the "Code:" prefix in the timestamps.

Evaluating math expressions is not an easy problem to solve, despite seeming extremely simple.
This video is a step by step guide to doing so, taking you through the motivations behind these steps as well.

This is my entry for the Summer of Math Exposition, hosted by ‪@LeiosLabs‬ and ‪@3blue1brown‬
https://some.3b1b.co/

Timestamps:
0:00 - Intro
1:15 - Lexer/Tokenizer
3:04 - Code: Lexer Implementation
4:33 - Beyond Lexing
5:46 - Structuring Math Expressions
7:03 - Code: Representing AST Nodes
7:46 - Evaluating an AST
9:44 - Code: Basic Parsing Structure
11:02 - Order of Operations
12:12 - A general expression
13:57 - Colouring expressions
16:19 - Code: Parse Expression function logic
19:14 - Parenthesized Expressions
19:57 - Code: Parsing "Terminal" expressions
21:51 - Finished the basic pipeline
22:06 - Code Bonus: Implicit Multiplication
23:14 - Recap and outro

Links:
Tagged Unions - https://en.wikipedia.org/wiki/Tagged_...
Or possibly, a nicer alternative - https://blog.ryanmartin.me/tagged-unions

Code for this project in C - https://github.com/PixelRifts/math-ex...

Discord - Discord: discord

Thanks to:
Garklein
Allen4th
IdkRandomTry
s m p l
Asher
GamesWithGabe
for your feedback

Music:
Somnia I - Reed Mathis
Interplanetary Alignment - NoMBe
Creeping Up on You - Godmode

#SoME3 #C #calculator
#MadeWithMotionCanvas
پارسال در تاریخ 1402/04/29 منتشر شده است.
29,999 بـار بازدید شده
... بیشتر