Changes in Base.cls:
Changes in the days code:
This is the source code for my advent of code 2021 using objectscript classes.
From Advent Of Code:
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
Make sure you have git,
and if you wish to run inside a docker then make sure you also have Docker desktop installed,
or if you want to install using zpm then make sure you have ObjectScript Package Manager installed in your IRIS server.
in the namespace prompt:
zpm
inside zpm shell:
install aoc-2021-uvg
Clone/git pull the repo into any local directory
$ git clone https://github.com/uvg/AdventOfCode2021Uvg.git
Open the terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d
Put all your input data into files in a specific folder, and set the Folder parameter inside Class AOC2021.Base
Open IRIS terminal. For docker:
$ docker-compose exec iris iris session iris
And enter the following command to run the first day both parts:
USER>do ##class(AOC2021.Day01).Run()
; to run all exercises use
for day=0:1:25 set zday=day set:zday<10 zday=0_day do $classmethod("AOC2021.Day"_zday,"Run")
; to run all exercises while printing message use
for day=0:1:25 set zday=day set:zday<10 zday=0_day do $classmethod("AOC2021.Day"_zday,"Run",1)
; to run all exercises part 1 use
for day=0:1:25 set zday=day set:zday<10 zday=0_day do $classmethod("AOC2021.Day"_zday,"Run",,1)
; to run all exercises part 2 use
for day=0:1:25 set zday=day set:zday<10 zday=0_day do $classmethod("AOC2021.Day"_zday,"Run",,2)
The script in Installer.cls will import everything you place under /src into IRIS.
The simplest dockerfile which starts IRIS and imports code from /src folder into it.
Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
Settings file to let you immedietly code in VSCode with VSCode ObjectScript plugin)
Config file if you want to debug with VSCode ObjectScript