Our great sponsors
- InfluxDB - Collect and Analyze Billions of Data Points in Real Time
- SonarQube - Static code analysis for 29 languages.
- Onboard AI - Learn any GitHub repo in 59 seconds
- Revelo Payroll - Free Global Payroll designed for tech teams
-
To solve this, I approached it much like making a video game. The blocks in the challenge description are referred to as "rocks with peculiar shapes," so I made a Rock class that represents one such rock. The exact shape is defined by a pattern list that has one string per row, just like in the challenge. The Rock class has methods to check whether it would hit something (the an already-placed Rock, or the edge of the pit) at a given x,y position; and to "settle" (that is, add itself permanently to the pit).
-
adventofcode
Advent of Code solutions of 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022 in Scala (by sim642)
Welcome back to my series of Advent of Code solutions in MiniScript! In Day 17 we got to (sort of) play Tetris. Five different Tetris-like shapes fall into a pit, moved left or right on each step according to the input. The first task is to see how high this stack will grow after 2022 blocks have been dropped in.
-
InfluxDB
Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.