Skip to content
Snippets Groups Projects
Commit d61ef451 authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Telematica ass2: Added code to report.

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