192 \begin{boxedminipage}{\textwidth} |
192 \begin{boxedminipage}{\textwidth} |
193 \begin{center} |
193 \begin{center} |
194 \includegraphics[scale=0.15]{../pics/vscode.png}\\[-10mm]\mbox{} |
194 \includegraphics[scale=0.15]{../pics/vscode.png}\\[-10mm]\mbox{} |
195 \end{center} |
195 \end{center} |
196 \caption{My installation of VS Code includes the following |
196 \caption{My installation of VS Code includes the following |
197 packages from Marketplace: \textbf{Scala Syntax (official)} 0.3.4, |
197 packages from Marketplace: \textbf{Scala Syntax (official)} 0.5.4, |
198 \textbf{Code Runner} 0.9.13, \textbf{Code Spell Checker} 1.7.17, |
198 \textbf{Code Runner} 0.11.6, \textbf{Code Spell Checker} 2.0.12, |
199 \textbf{Rewrap} 1.9.1 and \textbf{Subtle Match |
199 \textbf{Rewrap} 1.14.0 and \textbf{Subtle Match |
200 Brackets} 3.0.0. I have also bound the keys \keys{Ctrl} \keys{Ret} to the |
200 Brackets} 3.0.0. I have also bound the keys \keys{Ctrl} \keys{Ret} to the |
201 action ``Run-Selected-Text-In-Active-Terminal'' in order to quickly |
201 action ``Run-Selected-Text-In-Active-Terminal'' in order to quickly |
202 evaluate small code snippets in the Scala REPL. I use the internal |
202 evaluate small code snippets in the Scala REPL. I use the internal |
203 terminal to run Scala 2.13.1.\label{vscode}} |
203 terminal to run Scala 2.13.6.\label{vscode}} |
204 \end{boxedminipage} |
204 \end{boxedminipage} |
205 \end{figure} |
205 \end{figure} |
206 |
206 |
207 What I like most about VS Code is that it provides easy access to the |
207 What I like most about VS Code is that it provides easy access to the |
208 Scala REPL. But if you prefer another editor for coding, it is also |
208 Scala REPL. But if you prefer another editor for coding, it is also |
378 viewer.updateUI() |
378 viewer.updateUI() |
379 } |
379 } |
380 \end{lstlisting}} |
380 \end{lstlisting}} |
381 & |
381 & |
382 {\footnotesize\begin{lstlisting}[xleftmargin=0mm] |
382 {\footnotesize\begin{lstlisting}[xleftmargin=0mm] |
383 for (y <- (0 until H)/*@\keys{\texttt{.par}}@*/) { |
383 for (y <- (0 until H).par) { |
384 for (x <- (0 until W)/*@\keys{\texttt{.par}}@*/) { |
384 for (x <- (0 until W).par) { |
385 |
385 |
386 val c = start + |
386 val c = start + |
387 (x * d_x + y * d_y * i) |
387 (x * d_x + y * d_y * i) |
388 val iters = iterations(c, max) |
388 val iters = iterations(c, max) |
389 val colour = |
389 val colour = |
459 programs. Once you installed Scala, you can start the interpreter by |
459 programs. Once you installed Scala, you can start the interpreter by |
460 typing on the command line: |
460 typing on the command line: |
461 |
461 |
462 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] |
462 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] |
463 $ scala |
463 $ scala |
464 Welcome to Scala 2.13.1 (Java HotSpot(TM) 64-Bit Server VM, Java 9). |
464 Welcome to Scala 2.13.6 (OpenJDK 64-Bit Server VM, Java 17). |
465 Type in expressions for evaluation. Or try :help. |
465 Type in expressions for evaluation. Or try :help. |
466 |
466 |
467 scala> |
467 scala> |
468 \end{lstlisting}%$ |
468 \end{lstlisting}%$ |
469 |
469 |
1715 this document and teach in the lectures. Fortunately there are a |
1715 this document and teach in the lectures. Fortunately there are a |
1716 number of free books |
1716 number of free books |
1717 about Scala and of course lots of help online. For example |
1717 about Scala and of course lots of help online. For example |
1718 |
1718 |
1719 \begin{itemize} |
1719 \begin{itemize} |
1720 \item \url{http://www.scala-lang.org/docu/files/ScalaByExample.pdf} |
1720 %%\item \url{http://www.scala-lang.org/docu/files/ScalaByExample.pdf} |
1721 \item \url{http://www.scala-lang.org/docu/files/ScalaTutorial.pdf} |
1721 %%\item \url{http://www.scala-lang.org/docu/files/ScalaTutorial.pdf} |
1722 \item \url{https://www.youtube.com/user/ShadowofCatron} |
1722 \item \url{https://www.youtube.com/user/ShadowofCatron} |
1723 \item \url{http://docs.scala-lang.org/tutorials} |
1723 \item \url{http://docs.scala-lang.org/tutorials} |
1724 \item \url{https://www.scala-exercises.org} |
1724 \item \url{https://www.scala-exercises.org} |
1725 \item \url{https://twitter.github.io/scala_school} |
1725 \item \url{https://twitter.github.io/scala_school} |
1726 \end{itemize} |
1726 \end{itemize} |