Tutorial Challenges

Solve These First

The tutorial challenges are there to show new players how their submissions need to be formatted prior to posting them to the site. Prior to trying the other challenges on the site, we recommend you solve the Tutorial challenges first to set you up for success as you progress further.

Hello World

This has long been the first program any guide on programming uses to demonstrate the language. In RunCode, we have you submit this first to verify you understand the format that your submissions need to be in (and that you have a basic functional proficiency in your language.)

Interpreted (Scripting) Languages Must Include a Shebang

The shebang is an interpreter directive to a program loader that directs what interpreter program should be used to parse the rest of the script that follows.

For example, #!/bin/sh at the top of a shell script would indicate that /bin/sh should be used to interpret what follows.

The following examples demonstrate the correct way to submit a script for the languages we support:

Bourne-Again Shell (BASH)

hello_world.sh:

#!/bin/bash
echo "Hello, World!"

Common Lisp

hello_world.lsp:

Nodejs

hello_world.js:

Perl 5

hello_world.pl:

PHP

hello_world.php:

Python

hello_world.py:

Python 3

hello_world.py:

Ruby

hello_world.rb:

hello_world_object_oriented.rb:

Scala

hello_world.scala:

Compiled Language Submissions Must be Source Code (No Binaries)

Since compiled languages can’t be executed before being compiled (and because there is no interpreter involved), the shebang line is unnecessary. Instead, you can simply submit the source code for your solutions. They will be compiled and validated once they are received.

The following are examples of correct Hello World submissions for the compiled languages that we support:

C

hello_world.c:

C++

hello_world.cpp:

Golang

hello_world.go:

Haskell

hello_world.hs:

Argumentative

Argumentative asks you to print all of the arguments to your app from the command-line. This challenge does not provide you with the number of arguments you should expect. Instead, your solution should be able to print one-to-many arguments to the screen.

For example, in the shell script below, there are four arguments provided at the command-line.

The solution, should provide all four arguments not including argument 0 (the app name itself).

Below are the solutions you should be able to provide to this tutorial challenge in any of the 14 languages you are using.

Bourn-Again Shell (BASH)

argumentative.sh:

Common Lisp

argumentative.lsp:

Nodejs

argumentative.js:

Perl 5

argumentative.pl:

PHP

argumentative.php:

Python

argumentative.py:

Python 3

argumentative3.py:

Ruby

argumentative.rb:

Scala

argumentative.scala:

Compiled Language Argumentative Solutions

The following are examples of correct Argumentative submissions for the compiled languages that we support:

C

argumentative.c:

C++

argumentative.cpp:

Golang 1.10.2

argumentative.go:

Haskell

argumentative.hs:

Last updated