Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/usr/bin/env pwsh
- param (
- [string]$PuzzleInputFileName = "./2022/17.sample.input",
- [string]$RockInputFileName = "./2022/17.rocks.input"
- )
- $fallHeight = 3
- $worldWidth = 7
- $rocks = New-Object Collections.Generic.List[System.Tuple[int,int]]
- $world = New-Object Collections.Generic.Stack[String]
- function Get-Rock() {
- param (
- [string] $rockString
- )
- $rock = New-Object 'Collections.Generic.List[System.Tuple[int,int]]'
- $x = 0
- $y = 0
- for ($i = 0; $i -lt $rockString.Length; $i++) {
- if ($rockString[$i] -eq "`n") {
- $y++
- $x = 0
- } else {
- $rock.Add(([System.Tuple]::Create( $x++, $y )))
- }
- }
- [System.Tuple[int,int]] $returnValue
- $returnValue = $rock.ToArray()
- return $returnValue
- }
Advertisement
Add Comment
Please, Sign In to add comment