Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Latest commit

 

History

History

day10

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

NullTek Documentation --- Day 10: Syntax Scoring ---

This package contains the source and data for day 10 of the challenge.

  • Status: Complete
  • Difficulty Rating: 1.5 / 5

Post-Task Thoughts

Another good task, although I feel like I've had to do this same problem a bunch of times in the past. So I was a little bored by having to build the usual syntax parsing tree.

My design just used ChunkTreeNode objects that contained a uni-directional reference to their parent node. Then it's simply a matter of loading the symbols in by walking all the way down a tree branch and back up. If you reach the top of the branch again the line is syntactically complete. So to auto complete this you just have to populate any remaining symbols based on parents that exist between your current location and the root node of the tree.

Some may find this difficult if they have never had to do any sort of abstract syntax tree parsing before? But it seemed relatively straight forward to me.