Overview
To work through Learntris and other coding challenges here, you'll write a program on your local computer in the language of your choice. The only requirement is that your program write to standard output and read lines either from standard input or a text file.
To test your program, you need to install tanco
.
Tanco is a command-line program that runs your program
and sends it inputs from our server. Tanco reports the output
of your program to the server for scoring.
Once you pass a test, it will download a rule to check that test locally.
Alpha Version
Note that this is an alpha version of the system, and not everything is working yet.
Current limitations:
- You will need a Google account to log in.
- Firefox login is not yet working. (Chrome works. If you have trouble with another browser, please let us know).
If you need help with any of the steps below, please
ask for help in #setup-help
on our discord server.
Getting Set up
Tanco is a command line program written in python. You will need to install
python, then install the tanco
package, and then use tanco
to connect to the server.
-
First Install Python 3.11 or newer.
tanco
. Tanco is written in python, so you need to install python first. Python should come with a program called
pip
that lets you install packages. It might be calledpip3.11
orpip3
on your machine, especially if you have other versions of python installed. If for some reason you don't have it, runpython -m ensurepip
to install it.Install
tanco
with the command:pip install tanco
If you already had
tanco
installed (because you worked through the above steps in the past) you can run :pip install --upgrade tanco
to make sure you have the latest version.- Ensure that you can run the
tanco
command. It should show you a list of available sub-commands, like so:tanco command line client usage: tanco [command] available commands: challenges : List challenges check : Check that the target program runs delete : Delete a challenge import : Import a challenge init : Create .tanco file in current directory login : Login to the server next : Fetch the next test show : Show the current test prompt test : Run the tests whoami : Show the current user shell : Run an interactive shell
- Run
tanco login
to log into the server through your web browser. For this alpha testing phase, you will need a Google account to log in. Also, logging in with Firefox login is not yet working. (The login page currently requires third-party cookies, which Firefox blocks by default.) - Create a working directory for your program. It's not
absolutely required, but it's a good idea to set up version
control in the directory, perhaps with
git init
. Run
tanco init
in the working directory to create a.tanco
file. This file will store your login credentials and other information about the challenge.tanco
will list the available challenges and prompt you to enter a challenge name. Enterlearntris-classic
.- Write a program that does nothing, using your language of choice.
- Edit the
.tanco
file to tell it how to run your program. - Run
tanco check
to test your configuration until the program runs. - Once
tanco check
can run your program, you're ready to go.
Working through the challenge.
Once you have launched a challenge attempt, you can view the test prompts either in your terminal or through the actually-RESTful API at https://tanco.tangentcode.com/.
From the API, click "my data" and then the link for the attempt. This will take you to a page that is connected to the server with a websocket and will show live updates as you run the tests on your local machine.
From your terminal, the main workflow looks like this:
# already done: # run `tanco login` # to log in with google account. # run `tanco init` # to select challenge ande create a .tanco file make a do-nothing program while `tanco check` is not passing: tweak `.tanco` file you now start with 0 tests, so... run `tanco next` to get the first test while challenge is not complete: if `tanco test` fails: edit program to pass the failing tests else: commit any changes refactor or optimize your code (if you like) if you're ready to continue: run `tanco next` to get the next test