You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala> w.drawText("Hello introprog.PixelWindow!", x =100, y =100)
33
+
```
34
+
35
+
If you want to use `introprog` in your program, add these magic comment lines starting with `//>` in the beginning of your Scala 3 file (update the version number after `//> using scala` to the [latest release](https://www.scala-lang.org/)):
23
36
24
37
```
25
38
//> using scala 3.5.2
26
39
//> using dep se.lth.cs::introprog:1.3.1
27
40
```
28
41
29
-
You run your code with `scala-cli run .` (note the ending dot, meaning "this dir")
42
+
You can then run your code with `scala run .` (note the ending dot, meaning "current dir")
30
43
31
44
If your program looks like this:
32
45
@@ -42,20 +55,18 @@ You should see green text in a new window after executing:
42
55
```
43
56
scala-cli run .
44
57
```
45
-
See: [api documentation for PixelWindow](https://fileadmin.cs.lth.se/pgk/api/api/introprog/PixelWindow.html)
58
+
See: [api documentation for PixelWindow](https://fileadmin.cs.lth.se/pgk/api/api/introprog/PixelWindow.html) for more things you can do with a PixelWindow.
46
59
47
-
You can also give the `introprog` dependency directly at the command line, instead of the `using lib` directive:
60
+
You can also give the `introprog` dependency directly at the command line, instead of the `using dep` directive:
48
61
```
49
62
scala-cli run . --dep se.lth.cs::introprog:1.4.0
50
63
```
51
64
52
-
### Using sbt
65
+
### Getting started using sbt
53
66
54
-
You need [Scala Build Tool](https://www.scala-sbt.org/download.html) at least version 1.5.2 (preferably 1.6.2 or later).
55
-
56
-
Put this text in a file called `build.sbt`
67
+
If you use the [Scala Build Tool, version 1.6 or later](https://www.scala-sbt.org/download.html) then put this text in a file called `build.sbt`
@@ -68,6 +79,7 @@ scala> val w = new introprog.PixelWindow()
68
79
scala> w.fill(100,100,100,100,java.awt.Color.red)
69
80
```
70
81
See: [api documentation for PixelWindow](https://fileadmin.cs.lth.se/pgk/api/api/introprog/PixelWindow.html)
82
+
71
83
### Older Scala versions
72
84
73
85
If you want to use Scala 2.13 with 2.13.5 or later then use these special settings in `build.sbt`, esp. note that you should use version 1.1.5 of introprog:
0 commit comments