--- a/slides/slides05.tex Fri Oct 25 14:33:35 2013 +0100
+++ b/slides/slides05.tex Fri Oct 25 17:06:19 2013 +0100
@@ -20,6 +20,8 @@
\usetikzlibrary{calc}
\usepackage{graphicx}
\usepackage{pgfplots}
+\usepackage{fontspec}
+\setmonofont{Consolas}
\definecolor{javared}{rgb}{0.6,0,0} % for strings
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
@@ -31,19 +33,6 @@
\@empty\z@\@empty
\makeatother
-\lstset{language=Java,
- basicstyle=\consolas,
- keywordstyle=\color{javapurple}\bfseries,
- stringstyle=\color{javagreen},
- commentstyle=\color{javagreen},
- morecomment=[s][\color{javadocblue}]{/**}{*/},
- numbers=left,
- numberstyle=\tiny\color{black},
- stepnumber=1,
- numbersep=10pt,
- tabsize=2,
- showspaces=false,
- showstringspaces=false}
\lstdefinelanguage{scala}{
morekeywords={abstract,case,catch,class,def,%
@@ -52,8 +41,8 @@
new,null,object,override,package,%
private,protected,requires,return,sealed,%
super,this,throw,trait,true,try,%
- type,val,var,while,with,yield, then},
- otherkeywords={=>,<-,<\%,<:,>:,\#,@,->},
+ type,val,var,while,with,yield},
+ otherkeywords={=>,<-,<\%,<:,>:,\#,@},
sensitive=true,
morecomment=[l]{//},
morecomment=[n]{/*}{*/},
@@ -62,8 +51,20 @@
morestring=[b]"""
}
+\lstdefinelanguage{while}{
+ morekeywords={while, if, then. else, read, write},
+ otherkeywords={=>,<-,<\%,<:,>:,\#,@},
+ sensitive=true,
+ morecomment=[l]{//},
+ morecomment=[n]{/*}{*/},
+ morestring=[b]",
+ morestring=[b]',
+ morestring=[b]"""
+}
+
+
\lstset{language=Scala,
- basicstyle=\consolas,
+ basicstyle=\ttfamily,
keywordstyle=\color{javapurple}\bfseries,
stringstyle=\color{javagreen},
commentstyle=\color{javagreen},
@@ -342,7 +343,7 @@
\mode<presentation>{
\begin{frame}[c]
-\texttt{\consolas\lstinputlisting{../progs/fib.while}}
+\mbox{\lstinputlisting[language=while]{../progs/fib.while}}
\end{frame}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -351,7 +352,7 @@
\mode<presentation>{
\begin{frame}[c]
-\texttt{\consolas\lstinputlisting{../progs/collatz.while}}
+\mbox{\lstinputlisting[language=while]{../progs/collatz.while}}
\end{frame}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -361,7 +362,7 @@
\mode<presentation>{
\begin{frame}[c]
-\texttt{\consolas\lstinputlisting{../progs/loops.while}}
+\mbox{\lstinputlisting[language=while]{../progs/loops.while}}
\begin{textblock}{6}(10,2)
\begin{tikzpicture}[scale=0.46]