Commit d61ef451 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Telematica ass2: Added code to report.

parent 01dfe8cf
\documentclass[10pt,a4paper]{article}
\usepackage{float, url}
% Load code highlighter color scheme
\input{colors}
\title{Telematica assignment 2: Google Translate}
\author{Tadde\"us Kroes (6054129) \and Sander van Veen (6167969)}
......@@ -90,4 +93,12 @@ return $response["data"]["translations"][0]["translatedText"];
\end{verbatim}
% }}}
\appendix
\section{Code} % {{{
\input{translate}
% }}}
\end{document}
......@@ -22,7 +22,7 @@ function translate($text, $from, $to) {
if( $argc != 3 ) {
echo sprintf("Usage: %s FROM TO\n", $argv[0]);
if( $argv[1] == "--help" ) {
if( $argc > 1 && $argv[1] == "--help" ) {
echo "FROM is the input language, TO is the language to translate to.\n"
."Both languages should be entered as a 2-character long code.\n";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment