Skip to content

run4w4y/nti_irs

Repository files navigation

Actions Status

Building the code

With nix

You can build the code via nix-build:

nix-build

or using nix-shell:

nix-shell --run ./build.sh

Without nix

./build.sh

Build daily solutions

To get your day solutions built do:

./batchBuild.sh dayN

This will result in files like builds/out/dayN/real_1_1.js and so on. To have your build output uploaded as well, add --upload ip1 ip2 ... in the end of the command above.

Note that builds/in/dayN.in must be defined for that. To pass the inputs from .in file to your haxe code use @:inputFrom metadata. Example:

class Model extends RobotModel {
    @:inputFrom("real_1")
    static function getInput():String return "";
    
    override public function solution():Void {
        // your solution goes here
    }
}

Uploading builds

Upload and run

./trikRun.sh [path] [ip]

Script.print calls are echoed to stdout while script runs. Ctrl+C stops execution on the TRIK brick. You can also omit the ip if it's meant to be 192.168.77.1

Upload

./upload.sh [path1 path2 ...] -- [ip1 ip2 ...]

-- is omittable if there's only one ip

Development

Entering nix-shell

nix-shell --pure

Run unit tests

With nix

nix test.nix

Without nix/within nix-shell

haxe test.hxml

Tips

You might want to use xclip CLI tool, to copy and paste code in the TRIK Studio faster. Example usage:

xclip -sel cli < result/patched.js

This command copies the contents of result/build.js to your clipboard.

Working without nix

Configuring haxelib

haxelib setup ./lib

Installing dependencies

Build dependencies:

haxelib install build.hxml

Tests dependencies:

haxelib install test.hxml

Second stage solutions

You can find our team solutions for the second stage online tasks in the archive folder.

Documentation

Documentation is currently being written. You can check out what's got documented so far in Wiki