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 Codewarz, 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 4.4.19)
hello_world.sh:
Common Lisp
hello_world.lsp:
Nodejs 10.2.1
hello_world.js:
Perl 5 (5.26.1)
hello_world.pl:
PHP (7.2.5)
hello_world.php:
Python (2.7.15)
hello_world.py:
Python 3 (3.6.5)
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:
C#
hello_world.cs:
Golang 1.10.2
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.
$ ./your_app.sh one two three four
The solution, should provide all four arguments not including argument 0 (the app name itself).
$ ./your_app.sh one two three four
one two three four
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 4.4.19)
argumentative.sh:
Common Lisp
argumentative.lsp:
Nodejs 10.2.1
argumentative.js:
Perl 5 (5.26.1)
argumentative.pl:
PHP (7.2.5)
argumentative.php:
Python (2.7.15)
argumentative.py:
Python 3 (3.6.5)
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:
C#
argumentative.cs:
Golang 1.10.2
argumentative.go:
Haskell
argumentative.hs: