├── .github └── workflows │ └── main.yml ├── .gitignore ├── .vscode └── settings.json ├── LICENSE-CC-BY-SA-4.0.txt ├── README.md ├── about ├── course-experience-first-year │ ├── code │ │ ├── JPerson.java │ │ ├── Person.scala │ │ └── SPerson.scala │ ├── course-experiences.pdf │ ├── course-experiences.tex │ ├── img │ │ ├── 2015.jpg │ │ ├── 2016.jpg │ │ ├── CEQ-2015.jpg │ │ ├── CEQ-2016.jpg │ │ ├── Q-exam-hard.jpg │ │ ├── Q-kontroll.jpg │ │ ├── Q-learn-quick.jpg │ │ ├── Q-learned.jpg │ │ ├── Q-scala.jpg │ │ ├── Q-tempo.jpg │ │ ├── grades-2015.pdf │ │ ├── lang-2015.pdf │ │ ├── lewisbook.jpg │ │ ├── odersky.png │ │ ├── pinsbook.jpg │ │ └── survey-2015.pdf │ └── lecturenotes.cls ├── info-ekosystemteknik │ └── slides.scala ├── scala-as-a-beginner-language │ ├── img │ │ ├── grades-2015.pdf │ │ ├── lang-2015.pdf │ │ └── survey-2015.pdf │ ├── lecturenotes.cls │ ├── scala-first.pdf │ └── scala-first.tex └── scala-intro-for-java-devs │ ├── code │ ├── JPerson.java │ ├── Person.scala │ └── SPerson.scala │ ├── img │ └── odersky.png │ ├── lecturenotes.cls │ ├── scala-intro.pdf │ └── scala-intro.tex ├── build.sbt ├── compendium ├── .gitignore ├── README.md ├── assignments.tex ├── compendium.cls ├── compendium.tex ├── compendium1.tex ├── compendium2.tex ├── cover │ ├── cover-A3-part1.tex │ ├── cover-A3-part2.tex │ ├── cover-body.tex │ └── gurka.jpg ├── examples │ ├── ActivationRecord.scala │ ├── AliensOnEarth.scala │ ├── DiceReg.java │ ├── DiceReg2.java │ ├── DiceScanBuggy.java │ ├── Disk.scala │ ├── Hi.java │ ├── JComplex.java │ ├── JComplexTest.java │ ├── JMutablePoint3D.java │ ├── JPerson.java │ ├── JPoint3D.java │ ├── Match.scala │ ├── Snake.scala │ ├── Square.scala │ ├── StringEqTest.java │ ├── Switch.java │ ├── TryCatch.java │ ├── complex1.scala │ ├── complex2.scala │ ├── complex3.scala │ ├── complex4.scala │ ├── complex5.scala │ ├── complex6.scala │ ├── complex7.scala │ ├── diagonistic-test-2016 │ │ ├── Bonus.scala │ │ ├── BonusRegister.scala │ │ ├── IdPrinter.scala │ │ ├── JRotate.java │ │ ├── RandomId.scala │ │ ├── geometry-test.sc │ │ ├── geometry.scala │ │ ├── points.txt │ │ └── solutions │ │ │ ├── BonusRegister.scala │ │ │ ├── IdPrinter.scala │ │ │ ├── RandomId.scala │ │ │ └── Rotate.scala │ ├── europa.txt │ ├── exam │ │ └── re-impl-java-exams │ │ │ └── timeplanner-160824 │ │ │ ├── timeplanner-spec2.scala │ │ │ ├── timeplanner-spec3.scala │ │ │ ├── timeplanner1.scala │ │ │ ├── timeplanner2.scala │ │ │ ├── timeplanner3.scala │ │ │ └── timplanner-spec1.scala │ ├── hello-indent.scala │ ├── hello-primitive-main.scala │ ├── hello-script.scala │ ├── hello.sc │ ├── hello.scala │ ├── index-of-min.scala │ ├── irritext │ │ └── irritext.scala │ ├── localMutability.scala │ ├── lth-courses │ │ └── courses.scala │ ├── match │ │ ├── Switch.java │ │ ├── SwitchForgotBreak.java │ │ └── SwitchNoBreak.java │ ├── matrix │ │ └── ArrayMatrix.java │ ├── maxn.scala │ ├── maxn2.scala │ ├── mixin.scala │ ├── numbers.scala │ ├── polynomial │ │ └── polynomial.scala │ ├── scalajava │ │ ├── Autoboxing.java │ │ ├── Autoboxing2.java │ │ ├── Hangman.java │ │ ├── JMain.java │ │ ├── JMutablePerson.java │ │ ├── JPerson.java │ │ ├── JPoint.java │ │ ├── JShowInt.java │ │ ├── Main.scala │ │ ├── Point.scala │ │ ├── Test.java │ │ ├── generics │ │ │ ├── Point.java │ │ │ ├── PointCanEquals.java │ │ │ ├── PolygonCanContains.java │ │ │ ├── TestGenerics.java │ │ │ ├── TestIntegerList.java │ │ │ ├── TestIntegerListAutoboxing.java │ │ │ ├── TestPitfall1.java │ │ │ ├── TestPitfall2.java │ │ │ ├── TestPitfall3.java │ │ │ └── TestSet.java │ │ ├── hangman1.scala │ │ ├── hangman2.scala │ │ ├── list │ │ │ ├── Point.java │ │ │ ├── Polygon.java │ │ │ ├── PolygonTest.java │ │ │ ├── build.sh │ │ │ └── run.sh │ │ ├── ortsnamn.txt │ │ └── vector │ │ │ ├── Point.java │ │ │ ├── Polygon.java │ │ │ └── PolygonTest.java │ ├── sequences │ │ ├── NanananananananaNanananananananaBatman.scala │ │ ├── PointSeqUtils.scala │ │ ├── Polygon.scala │ │ ├── PolygonArray.scala │ │ ├── PolygonTest.scala │ │ ├── PolygonWindow.scala │ │ ├── RegisterToggleWinner.scala │ │ ├── Timer.scala │ │ ├── build.sbt │ │ └── project │ │ │ └── build.properties │ ├── simple-web-server │ │ ├── fibserver-threaded-memcached-while.scala │ │ ├── fibserver-threaded-memcached.scala │ │ ├── fibserver-threaded.scala │ │ ├── fibserver.scala │ │ ├── sunserver-fastfib-memchached-while.scala │ │ ├── sunserver-fibserver-memcachsed-while.scala │ │ ├── sunserver-fibserver-memcachsed.scala │ │ ├── sunserver-fibserver.scala │ │ ├── sunserver-webserver.scala │ │ └── webserver.scala │ ├── sort │ │ └── JSort.java │ ├── sum-min-max.scala │ ├── sum.sc │ ├── sum.scala │ ├── sumn.scala │ ├── swap-args.scala │ ├── vegomatch.scala │ └── workspace │ │ ├── .gitignore │ │ ├── w05-seqalg │ │ ├── .gitignore │ │ ├── build.sbt │ │ ├── project │ │ │ └── build.properties │ │ └── src │ │ │ ├── FixSleepyBrain.scala │ │ │ ├── FixSleepyBrainRegisterChosen.scala │ │ │ ├── NanananananananaNanananananananaBatman.scala │ │ │ ├── Polygon.scala │ │ │ ├── PolygonArray.scala │ │ │ ├── PolygonVector.scala │ │ │ ├── PolygonWindow.scala │ │ │ ├── SeqCopyForJava.java │ │ │ ├── Timer.scala │ │ │ ├── names.txt │ │ │ ├── pointSeqUtils.scala │ │ │ ├── polygonTest1.scala │ │ │ ├── polygonTest2.scala │ │ │ ├── polygonTest3.scala │ │ │ ├── polygonTest4.scala │ │ │ ├── polygonTest5.scala │ │ │ ├── seqCopy.scala │ │ │ ├── seqCopyFor.scala │ │ │ └── seqCopyForYield.scala │ │ └── w07-inherit │ │ ├── build.sbt │ │ ├── project │ │ └── build.properties │ │ └── src │ │ ├── SimpleDrawingWindow.scala │ │ ├── draw.scala │ │ ├── personExample1.scala │ │ ├── personExample2.scala │ │ ├── personExample3.scala │ │ ├── shapes1.scala │ │ ├── shapes2.scala │ │ ├── shapesTest1.scala │ │ ├── shapesTest2.scala │ │ ├── vego1.scala │ │ ├── vego1Test.scala │ │ ├── vego2.scala │ │ ├── vego2Test.scala │ │ ├── vego3.scala │ │ └── vego4.scala ├── exercises.tex ├── generated │ ├── exercises-generated.tex │ ├── labs-generated.tex │ ├── names-generated.tex │ ├── quiz-w01-concepts-solurows-generated.tex │ ├── quiz-w01-concepts-taskrows-generated.tex │ ├── quiz-w01-intdiv-solurows-generated.tex │ ├── quiz-w01-intdiv-taskrows-generated.tex │ ├── quiz-w01-types-solurows-generated.tex │ ├── quiz-w01-types-taskrows-generated.tex │ ├── quiz-w01-values-solurows-generated.tex │ ├── quiz-w01-values-taskrows-generated.tex │ ├── quiz-w02-array-vector-append-solurows-generated.tex │ ├── quiz-w02-array-vector-append-taskrows-generated.tex │ ├── quiz-w02-array-vector-equality-solurows-generated.tex │ ├── quiz-w02-array-vector-equality-taskrows-generated.tex │ ├── quiz-w02-array-vector-mutability-solurows-generated.tex │ ├── quiz-w02-array-vector-mutability-taskrows-generated.tex │ ├── quiz-w02-collection-methods-solurows-generated.tex │ ├── quiz-w02-collection-methods-taskrows-generated.tex │ ├── quiz-w02-concepts-solurows-generated.tex │ ├── quiz-w02-concepts-taskrows-generated.tex │ ├── quiz-w02-for-yield-map-solurows-generated.tex │ ├── quiz-w02-for-yield-map-taskrows-generated.tex │ ├── quiz-w02-hello-scala-java-solurows-generated.tex │ ├── quiz-w02-hello-scala-java-taskrows-generated.tex │ ├── quiz-w03-code-fragments-solurows-generated.tex │ ├── quiz-w03-code-fragments-taskrows-generated.tex │ ├── quiz-w03-concepts-solurows-generated.tex │ ├── quiz-w03-concepts-taskrows-generated.tex │ ├── quiz-w03-function-values-solurows-generated.tex │ ├── quiz-w03-function-values-taskrows-generated.tex │ ├── quiz-w03-lambda-solurows-generated.tex │ ├── quiz-w03-lambda-taskrows-generated.tex │ ├── quiz-w03-yield-map-solurows-generated.tex │ ├── quiz-w03-yield-map-taskrows-generated.tex │ ├── quiz-w04-concepts-solurows-generated.tex │ ├── quiz-w04-concepts-taskrows-generated.tex │ ├── quiz-w05-case-class-solurows-generated.tex │ ├── quiz-w05-case-class-taskrows-generated.tex │ ├── quiz-w05-class-arg-solurows-generated.tex │ ├── quiz-w05-class-arg-taskrows-generated.tex │ ├── quiz-w05-class-instance-solurows-generated.tex │ ├── quiz-w05-class-instance-taskrows-generated.tex │ ├── quiz-w05-class-param-solurows-generated.tex │ ├── quiz-w05-class-param-taskrows-generated.tex │ ├── quiz-w05-concepts-solurows-generated.tex │ ├── quiz-w05-concepts-taskrows-generated.tex │ ├── quiz-w07-concepts-solurows-generated.tex │ ├── quiz-w07-concepts-taskrows-generated.tex │ ├── quiz-w07-seq-collections-solurows-generated.tex │ ├── quiz-w07-seq-collections-taskrows-generated.tex │ ├── quiz-w07-seq-find-solurows-generated.tex │ ├── quiz-w07-seq-find-taskrows-generated.tex │ ├── quiz-w07-seq-methods-solurows-generated.tex │ ├── quiz-w07-seq-methods-taskrows-generated.tex │ ├── quiz-w07-seq-sort-solurows-generated.tex │ ├── quiz-w07-seq-sort-taskrows-generated.tex │ ├── quiz-w07-seq-update-solurows-generated.tex │ ├── quiz-w07-seq-update-taskrows-generated.tex │ ├── quiz-w08-concepts-solurows-generated.tex │ ├── quiz-w08-concepts-taskrows-generated.tex │ ├── quiz-w09-concepts-solurows-generated.tex │ ├── quiz-w09-concepts-taskrows-generated.tex │ ├── quiz-w09-mapops-solurows-generated.tex │ ├── quiz-w09-mapops-taskrows-generated.tex │ ├── quiz-w09-setops-solurows-generated.tex │ ├── quiz-w09-setops-taskrows-generated.tex │ ├── quiz-w10-concepts-solurows-generated.tex │ ├── quiz-w10-concepts-taskrows-generated.tex │ ├── w01-chaphead-generated.tex │ ├── w02-chaphead-generated.tex │ ├── w03-chaphead-generated.tex │ ├── w04-chaphead-generated.tex │ ├── w05-chaphead-generated.tex │ ├── w06-chaphead-generated.tex │ ├── w07-chaphead-generated.tex │ ├── w08-chaphead-generated.tex │ ├── w09-chaphead-generated.tex │ ├── w10-chaphead-generated.tex │ ├── w11-chaphead-generated.tex │ ├── w12-chaphead-generated.tex │ ├── w13-chaphead-generated.tex │ └── w14-chaphead-generated.tex ├── global-constants.tex ├── labs.tex ├── lectures.tex ├── modules │ ├── old-assigment-life.tex │ ├── old-assignment-tabular.tex │ ├── old-classes-exercise.tex │ ├── old-classes-lab.tex │ ├── old-inheritance-lab-turtlerace.tex │ ├── old-lthopoly.tex │ ├── old-matrices-lab-maze.tex │ ├── old-objects-exercise-with-cslib.tex │ ├── old-patterns-lab.tex │ ├── old-patterns2-lab.tex │ ├── rename-script.scala │ ├── w01-intro-chapter.tex │ ├── w01-intro-exercise-goals.tex │ ├── w01-intro-exercise.tex │ ├── w01-intro-lab-goals.tex │ ├── w01-intro-lab.tex │ ├── w02-programs-chapter.tex │ ├── w02-programs-exercise-goals.tex │ ├── w02-programs-exercise.tex │ ├── w02-programs-lab.tex │ ├── w03-functions-chapter.tex │ ├── w03-functions-exercise-goals.tex │ ├── w03-functions-exercise.tex │ ├── w03-functions-lab-goals.tex │ ├── w03-functions-lab.tex │ ├── w04-objects-chapter.tex │ ├── w04-objects-exercise-goals.tex │ ├── w04-objects-exercise.tex │ ├── w04-objects-lab-goals.tex │ ├── w04-objects-lab.tex │ ├── w05-classes-chapter.tex │ ├── w05-classes-exercise-goals.tex │ ├── w05-classes-exercise.tex │ ├── w05-classes-lab.tex │ ├── w06-patterns-chapter.tex │ ├── w06-patterns-exercise.tex │ ├── w06-patterns-lab.tex │ ├── w07-sequences-chapter.tex │ ├── w07-sequences-exercise-goals.tex │ ├── w07-sequences-exercise.tex │ ├── w07-sequences-lab-goals.tex │ ├── w07-sequences-lab.tex │ ├── w08-matrices-chapter.tex │ ├── w08-matrices-exercise.tex │ ├── w08-matrices-lab.tex │ ├── w09-setmap-chapter.tex │ ├── w09-setmap-exercise-goals.tex │ ├── w09-setmap-exercise.tex │ ├── w09-setmap-lab-goals.tex │ ├── w09-setmap-lab.tex │ ├── w10-inheritance-chapter.tex │ ├── w10-inheritance-exercise-goals.tex │ ├── w10-inheritance-exercise.tex │ ├── w10-inheritance-lab-goals.tex │ ├── w10-inheritance-lab.tex │ ├── w11-context-chapter.tex │ ├── w11-context-exercise.tex │ ├── w11-context-lab.tex │ ├── w12-assignment-add-docs-task.tex │ ├── w12-assignment-bank.tex │ ├── w12-assignment-music.tex │ ├── w12-assignment-photo.tex │ ├── w12-assignment-tictactoe.tex │ ├── w12-extra-chapter.tex │ ├── w12-extra-exercise.tex │ ├── w12-old-sorting-lab.tex │ ├── w13-examprep-chapter.tex │ ├── w13-examprep-exercise.tex │ ├── w14-extra-chapter.tex │ ├── w14-extra-exercise.tex │ └── w14-extra-lab.tex ├── postchapters │ ├── build.tex │ ├── compile.tex │ ├── debug.tex │ ├── document.tex │ ├── ide-intellij-idea.tex │ ├── ide-scalaide-eclipse.tex │ ├── ide-vscode.tex │ ├── ide.tex │ ├── java-chapter.tex │ ├── java-exercise.tex │ ├── java-lab.tex │ ├── java.tex │ ├── kojo-commands.tex │ ├── kojo.tex │ ├── scalajs.tex │ ├── terminal.tex │ ├── vbox.tex │ └── version-control.tex ├── prechapters │ ├── course-architecture.tex │ ├── course-instructions.tex │ ├── how-to-contribute.tex │ ├── licence-contributors.tex │ ├── oral-test.tex │ ├── preface-compendium2.tex │ ├── preface.tex │ └── progress-forms.tex ├── project │ └── build.properties ├── solutions.tex └── team-lab-prep-items.tex ├── contributors.tex ├── glossary ├── Main.scala ├── StringExtras.scala ├── build.sbt ├── concepts-generated.html ├── concepts-generated.md ├── concepts-generated.tex ├── project │ └── build.properties └── tabular.scala ├── img ├── abc80.jpg ├── ada.jpg ├── ankbok.jpg ├── annexet.jpg ├── block-xy.jpg ├── blockbattle.png ├── blockmole-sky-grass.png ├── blockmole.png ├── blockworm.png ├── bomb-shelter.jpg ├── bonus-2016.pdf ├── boole.jpg ├── box.png ├── brain.png ├── bug.jpg ├── cat-vet.jpg ├── chords │ ├── ChordDraw.PNG │ └── guitar-C-major-chord.jpg ├── coffee-grinder.jpg ├── collection │ ├── collection-immutable.png │ ├── collection-legend.png │ ├── collection-mutable.png │ └── collection-traits.png ├── compendium-cover-part1-2020.png ├── compendium-cover-part1-2021.png ├── compendium-cover-part1-2022.png ├── compendium-cover-part2-2020.png ├── compendium-cover-part2-2021.png ├── compendium-cover-part2-2022.png ├── compendium-front-page-2016.png ├── compendium-front-page-2017.png ├── compendium-front-page-2019.png ├── compendium-front-page-part1-2018.png ├── crystal.jpg ├── dynamite.jpg ├── eclipse │ ├── eclipse-complete-main.png │ ├── eclipse-hello-world.png │ ├── eclipse-import-existing.png │ ├── eclipse-import-projects.png │ ├── eclipse-import.png │ ├── eclipse-open-perspective.png │ ├── eclipse-perspective-button.png │ ├── eclipse-pirates-hello.png │ ├── eclipse-scala-perspective.png │ ├── eclipse-select-workspace.png │ ├── eclipse-welcome.png │ └── scalaide-import-progress.png ├── egg-box-closed.png ├── egg-box.jpg ├── ehuset.jpg ├── eniac.jpg ├── ericsson-buy-api.png ├── frog.png ├── fyll-rak-fel.png ├── fyll-rak.png ├── glider-blinker-block.png ├── glider-gun.png ├── grace.jpg ├── graph.pdf ├── gurka-tomat-715x800.jpg ├── gurka-tomat-small.jpg ├── gurka.jpg ├── hierarchy.pdf ├── highscore.png ├── ibm3090.jpg ├── intellij │ ├── idea-complete-main.png │ ├── idea-hello.png │ ├── idea-import1-project.png │ ├── idea-import2-select.png │ ├── idea-import3-eclipse.png │ ├── idea-import4-directory.png │ ├── idea-import5-select-projects.png │ ├── idea-import6-code-style.png │ ├── idea-import6-select-SDK.png │ ├── idea-import7-setup-scala-sdk.png │ ├── idea-import8-add-scala-support.png │ ├── idea-import9-run.png │ ├── idea-new-hello-project.png │ ├── idea-new-project.png │ ├── idea-new-scala-class.png │ ├── idea-new-scala-project.png │ ├── idea-project-sdk-home.png │ ├── idea-project-sdk-jvm.png │ ├── idea-scala-object.png │ ├── idea-scala-sdk.png │ ├── idea-welcome.png │ ├── idea1-complete-installation.png │ └── import78-setup-scala-sdk.png ├── java-logo.png ├── javadoc │ ├── javadoc-class.png │ └── javadoc-overview.png ├── kids.jpg ├── koffmanbook.jpg ├── kojo-trace.png ├── kojo.png ├── kojo │ ├── color-circles.png │ ├── flowers.png │ ├── kojo.png │ ├── kvadrat.png │ ├── new.png │ ├── play.png │ ├── polygon.png │ ├── polygons-circle.png │ ├── race.png │ ├── random-circles.png │ ├── random-color-circles.png │ ├── random-walk.png │ ├── square-column.png │ ├── square-grid.png │ ├── square-param.png │ ├── square.png │ └── stairs.png ├── kompetensbrist.png ├── lewisbook.jpg ├── linux-terminal.png ├── list.pdf ├── logoLUeng.pdf ├── lulea-datacenter.jpg ├── motivation.png ├── mutant.png ├── nobody.png ├── pet-carrier.jpg ├── pinsbook.png ├── pirates │ ├── args.png │ ├── breakpoint.png │ ├── bug.png │ ├── createobject.png │ ├── createproject.png │ ├── exekvera.png │ ├── importproject.png │ ├── nameobject.png │ ├── nameproject.png │ ├── next.png │ ├── selectscala.png │ ├── selectws.png │ └── selectws2.png ├── plocklada.png ├── prompt.jpg ├── pypl-06-20.png ├── pypl.jpg ├── redmonk-Q122.png ├── redmonk-Q123.png ├── redmonk-Q318.png ├── redmonk-Q320.png ├── redmonk-Q321.png ├── redmonk-Q619.png ├── scala-icon.png ├── scala-logo.png ├── scaladoc │ ├── scaladoc-filter.png │ ├── scaladoc-find-fill.png │ ├── scaladoc-mio.png │ ├── scaladoc-root-old.png │ ├── scaladoc-root.png │ ├── scaladoc-vec.png │ └── scaladoc-vector.png ├── sigrid.png ├── snake-oneplayer.png ├── snake-start.png ├── snake-twoplayer.png ├── snurre-rect.png ├── stamp.jpg ├── survey-2015.pdf ├── survey-2020.png ├── survey-2021.png ├── survey-2022.png ├── survey-2023.png ├── survey-2024.png ├── survey │ ├── bar.png │ └── pie.png ├── tree.pdf ├── ttsuper.png ├── turtle.png ├── turtle │ └── RectSeq.png ├── turtlerace │ └── RaceWindow.PNG ├── ukulele.jpg ├── unplugged.jpg ├── vattenhallen.png ├── vm.png ├── vm2019-ehus.png ├── vm2019.png ├── vm2020-terminal.png ├── vm2020.png ├── vscode-debug.png ├── vscode-run.png ├── vscode-trace.png ├── w04-solutions │ ├── uppgift-13a.png │ ├── uppgift-13b-1.png │ ├── uppgift-13b-2.png │ ├── uppgift-13b-3.png │ ├── uppgift-13c-1.png │ ├── uppgift-13c-2.png │ ├── uppgift-13c-3.png │ └── uppgift-3a.png ├── w05-hands │ ├── flush.png │ ├── fours.png │ ├── fullhouse.png │ ├── none.png │ ├── pair.png │ ├── straight.png │ ├── straightflush.png │ ├── trips.png │ └── twopair.png ├── w05-solutions │ ├── memory-pic-2.png │ ├── memory-pic-3.png │ ├── memory-pic-4.png │ ├── memory-pic-5.png │ └── memory-pic-6.png ├── w06-lab │ ├── RectangleSequence.png │ └── RollingRectangle.png ├── w06-solutions │ ├── 1b.png │ └── 2b.png ├── w09-lab │ ├── AlgorithmVisualized.png │ ├── MazeAndMatrix.jpg │ └── RandomMaze.jpg ├── w09-solutions │ └── 1a.png ├── w11-lab │ ├── boarddiagram.png │ └── lthopoly.png ├── w12-assignment-photo │ ├── derivatabild2.pdf │ ├── filter.png │ ├── histo.pdf │ ├── photo-duck.png │ ├── photo-jay-sobel.png │ ├── photo-main.png │ ├── photo-xor.png │ └── sobeljay.png ├── w12-lab │ ├── glider.png │ ├── moore_neighborhood.png │ ├── quadtree_bitmap.png │ └── wireworld_computer.png └── w14 │ ├── most-loved-2016.png │ ├── scala-dotty-roadmap-odersky.jpeg │ ├── scala-dotty-roadmap.png │ ├── scala-jobs-indeed-2017.png │ └── scala-jobs-sweden-linkedin-2017-dec07.png ├── lib ├── cslib.jar └── workspace.zip ├── migration.md ├── old ├── survey-preknowledge.odt ├── survey-preknowledge.pdf └── tools │ ├── install-scala.bat │ ├── publish-tools.sh │ └── windows-jdk-set-path.bat ├── package.sh ├── plan ├── BookChapters.scala ├── Date.scala ├── Main.scala ├── Plan.scala ├── StringExtras.scala ├── TODO.md ├── Table.scala ├── build.sbt ├── concepts │ ├── concepts.csv │ ├── concepts.html │ └── makeConceptTable.scala ├── courseplan │ ├── .gitignore │ ├── courseplan.tex │ └── publish-courseplan.sh ├── ideas │ ├── chords.scala │ ├── chords.txt │ ├── gettersetter.scala │ ├── lab-sketches.md │ ├── matrix.scala │ ├── maze-simple.txt │ ├── minimal-http-server.scala │ ├── pixels │ │ └── pixels.scala │ ├── spawn-thread.scala │ ├── stock │ │ ├── aak.html │ │ ├── all.csv │ │ ├── gamla-aktielistan.html │ │ ├── stock.scala │ │ └── top.csv │ ├── tictactoe.scala │ └── trait-examples.scala ├── module-plan-generated.html ├── module-plan-generated.md ├── module-plan-generated.tex ├── overview-generated.tex ├── project │ └── build.properties ├── tentative-scala3-plan.md ├── week-plan-generated.html ├── week-plan-generated.md └── week-plan-generated.tex ├── project └── build.properties ├── publish.sh ├── quickref ├── .gitignore ├── java │ └── java-quickref.tex ├── quickref-2.12 │ ├── .gitignore │ ├── java-quickref-english.tex │ ├── java-snabbref-booklet.tex │ ├── quickref-booklet.tex │ └── quickref.tex ├── quickref-2.13 │ ├── java-quickref-english.tex │ ├── java-snabbref-booklet.tex │ ├── quickref-booklet.tex │ └── quickref.tex ├── quickref-booklet.tex ├── quickref-double.tex └── quickref.tex ├── quiz-concepts.tsv ├── quiz ├── Main.scala ├── QuizData.scala ├── TypesAndUtils.scala ├── build.sbt ├── project │ └── build.properties ├── quiz-concepts.tsv └── unfinished-stuff.scala ├── refs ├── ViktorsScalaOdyssey.pdf ├── scala-2016.pdf └── scala-history.pdf ├── show-scala-version.sh ├── slides ├── .gitignore ├── all-lectures.tex ├── body │ ├── lect-preamble.tex │ ├── lect-w01-about.tex │ ├── lect-w01-intro.tex │ ├── lect-w02-codestruct.tex │ ├── lect-w02-how-to-study.tex │ ├── lect-w03-course-ombudsmen.tex │ ├── lect-w03-functions.tex │ ├── lect-w04-objects.tex │ ├── lect-w05-assignments.tex │ ├── lect-w05-case-classes.tex │ ├── lect-w05-classes.tex │ ├── lect-w05-equality.tex │ ├── lect-w05-muddiest-point.tex │ ├── lect-w05-specifications.tex │ ├── lect-w06-assignments.tex │ ├── lect-w06-equals.tex │ ├── lect-w06-exceptions.tex │ ├── lect-w06-matching.tex │ ├── lect-w06-option.tex │ ├── lect-w07-assignments.tex │ ├── lect-w07-diagnostic-test.tex │ ├── lect-w07-enums.tex │ ├── lect-w07-muddiest-point.tex │ ├── lect-w07-register.tex │ ├── lect-w07-seq-append-insert-remove.tex │ ├── lect-w07-seq-insert-remove-copy.tex │ ├── lect-w07-seq-seek-sort.tex │ ├── lect-w07-seq-string-compare.tex │ ├── lect-w07-seq-while.tex │ ├── lect-w07-seq.tex │ ├── lect-w07-varargs.tex │ ├── lect-w08-generics.tex │ ├── lect-w08-ide.tex │ ├── lect-w08-matrices.tex │ ├── lect-w08-reboot-camp.tex │ ├── lect-w08-special-teaching.tex │ ├── lect-w09-assigments.tex │ ├── lect-w09-collections.tex │ ├── lect-w09-inspections-snake.tex │ ├── lect-w09-inspections.tex │ ├── lect-w09-serialize.tex │ ├── lect-w10-assignments.tex │ ├── lect-w10-extends.tex │ ├── lect-w10-override.tex │ ├── lect-w10-shape.tex │ ├── lect-w11-context.tex │ ├── lect-w12-algorithms.tex │ ├── lect-w12-next-week.tex │ ├── lect-w12-project-assignment.tex │ ├── lect-w12-project-music.tex │ ├── lect-w12-search.tex │ ├── lect-w12-sort.tex │ ├── lect-w13-on-demand.tex │ ├── lect-w14-final.tex │ └── lect-wjava-body.tex ├── generated │ ├── w01-overview-generated.tex │ ├── w02-overview-generated.tex │ ├── w03-overview-generated.tex │ ├── w04-overview-generated.tex │ ├── w05-overview-generated.tex │ ├── w06-overview-generated.tex │ ├── w07-overview-generated.tex │ ├── w08-overview-generated.tex │ ├── w09-overview-generated.tex │ ├── w10-overview-generated.tex │ ├── w11-overview-generated.tex │ ├── w12-overview-generated.tex │ ├── w13-overview-generated.tex │ └── w14-overview-generated.tex ├── info-week00-online-2021.tex ├── info-week00.tex ├── lect-w01.tex ├── lect-w02.tex ├── lect-w03.tex ├── lect-w04.tex ├── lect-w05.tex ├── lect-w06.tex ├── lect-w07.tex ├── lect-w08.tex ├── lect-w09.tex ├── lect-w10.tex ├── lect-w11.tex ├── lect-w12.tex ├── lect-w13.tex ├── lect-w14.tex ├── lect-wjava.tex ├── lecturehandouts.cls ├── lecturenotes.cls ├── lecturesimple.cls ├── muddiest-point │ └── muddiest-point-2016oct3.ods ├── simple │ ├── intro.tex │ └── simpleslides.cls └── tabortmig.txt ├── study-groups ├── collaboration-contract.pdf └── collaboration-contract.tex ├── teachers └── course-dev-2016 │ ├── README.md │ ├── kickoff-2016march11.pdf │ ├── kickoff-2016march11.tex │ └── slides.cls ├── tests ├── kontroll2016okt25.pdf ├── kontroll2017okt24.pdf ├── solution2016okt25.pdf └── solution2017okt24.pdf ├── util ├── .gitignore ├── build.sbt ├── doc.sh ├── fixexercise │ ├── build.sbt │ ├── mergesolu.scala │ └── project │ │ └── build.properties ├── git-utils │ ├── dangerous-hard-reset.md │ ├── delete-a-branch.sh │ ├── scrap-all-pdfs.md │ └── scrap-all-pdfs.sh ├── mio.scala ├── prep.sh ├── prepend.scala ├── project │ └── build.properties ├── repl-output-update-tool │ ├── .vscode │ │ └── settings.json │ ├── README.md │ ├── build.sbt │ ├── project │ │ └── build.properties │ └── run-insert-error.scala ├── solucheck │ ├── README.md │ └── solucheck.scala └── src │ └── main │ └── scala │ └── util │ └── md.scala ├── vm └── README.md ├── web ├── build.sh ├── encoding │ ├── char-encoding-windows.md │ ├── intl.cpl.png │ └── utf-8.scala └── tools │ ├── adapter.jpg │ ├── tools.html │ └── tools.md ├── workspace-old ├── w05_turtle │ ├── .gitignore │ ├── compile.sh │ ├── download-cslib.sh │ ├── run.sh │ └── src │ │ └── main │ │ └── scala │ │ └── graphics │ │ ├── Demo.scala │ │ ├── Main.scala │ │ ├── Point.scala │ │ ├── Rect.scala │ │ ├── RectSeq.scala │ │ └── Turtle.scala ├── w08_maze │ └── src │ │ └── main │ │ ├── resources │ │ ├── maze1.txt │ │ ├── maze2.txt │ │ ├── maze3.txt │ │ └── maze4.txt │ │ └── scala │ │ ├── graphics │ │ └── SimpleTurtle.scala │ │ └── maze │ │ ├── Main.scala │ │ ├── Maze.scala │ │ └── MazeWalker.scala ├── w09_turtlerace_team │ ├── build.sbt │ └── src │ │ └── main │ │ └── scala │ │ └── turtlerace │ │ ├── ColorTurtle.scala │ │ ├── Main.scala │ │ ├── RaceTurtle.scala │ │ ├── RaceWindow.scala │ │ └── TurtleRace.scala ├── w10_music │ ├── build.sbt │ ├── project │ │ └── build.properties │ └── src │ │ └── main │ │ └── scala │ │ └── music │ │ ├── Chord.scala │ │ ├── ChordPlayer.scala │ │ ├── Main.scala │ │ ├── Pitch.scala │ │ ├── Synth.scala │ │ ├── commands.scala │ │ └── instruments.scala ├── w11_lthopoly_team │ └── src │ │ └── main │ │ ├── java │ │ └── lthopoly │ │ │ ├── GameBoard.java │ │ │ ├── Player.java │ │ │ ├── cards │ │ │ ├── MoneyCard.java │ │ │ └── MoveCard.java │ │ │ ├── parser │ │ │ └── DocumentParser.java │ │ │ └── spaces │ │ │ ├── BoardSpace.java │ │ │ ├── HouseSpace.java │ │ │ ├── MoneySpace.java │ │ │ └── MoveSpace.java │ │ ├── resources │ │ ├── board.txt │ │ ├── moneycards.txt │ │ └── movecards.txt │ │ └── scala │ │ └── lthopoly │ │ ├── Main.scala │ │ └── TextUI.scala ├── w12_survey │ └── src │ │ └── main │ │ ├── resources │ │ ├── favorit-snapshot.csv │ │ ├── favorit.csv │ │ └── out.csv │ │ └── scala │ │ └── stats │ │ ├── Chart.scala │ │ ├── Command.scala │ │ ├── Main.scala │ │ └── Table.scala ├── w13_img_proj │ ├── build.sbt │ ├── images │ │ ├── boy.jpg │ │ ├── car.jpg │ │ ├── duck.jpg │ │ ├── jay.jpg │ │ ├── moon.jpg │ │ └── shuttle.jpg │ ├── project │ │ └── build.properties │ └── src │ │ └── main │ │ └── scala │ │ └── imageproject │ │ ├── Image.scala │ │ └── ImageUI.scala ├── w13_life │ ├── README.md │ └── src │ │ └── main │ │ └── scala │ │ ├── cyclic.scala │ │ ├── entities │ │ └── entities.scala │ │ ├── glidercrash.scala │ │ ├── life.scala │ │ ├── life_console.scala │ │ ├── models │ │ ├── ArrayMatrix2D.scala │ │ └── Matrix2D.scala │ │ ├── rules │ │ ├── CyclicRule.scala │ │ ├── LifeRule.scala │ │ ├── NeighborsRule.scala │ │ ├── Rule.scala │ │ └── WireworldRule.scala │ │ ├── utils │ │ └── utils.scala │ │ ├── views │ │ ├── CellularConsoleView.scala │ │ ├── CellularGuiView.scala │ │ └── CellularView2D.scala │ │ └── wireworld.scala ├── w13_photo_proj_2022 │ ├── images │ │ ├── boy.jpg │ │ ├── car.jpg │ │ ├── duck.jpg │ │ ├── jay.jpg │ │ ├── moon.jpg │ │ └── shuttle.jpg │ ├── project.scala │ └── src │ │ └── main │ │ └── scala │ │ ├── Application.scala │ │ ├── ImageChooser.scala │ │ ├── ImageEditor.scala │ │ └── ImageFilter.scala ├── w13_tabular │ ├── build.sbt │ ├── favorit.csv │ ├── project │ │ └── build.properties │ └── src │ │ └── main │ │ ├── resources │ │ └── favorit.csv │ │ └── scala │ │ └── tabular │ │ ├── Cell.scala │ │ ├── Command.scala │ │ ├── Graph.scala │ │ ├── Main.scala │ │ └── Table.scala └── w13_tictactoe_proj │ └── src │ └── main │ └── scala │ └── tictactoe │ ├── Game.scala │ ├── HumanPlayer.scala │ ├── OptimalPlayer.scala │ └── Player.scala └── workspace ├── .gitignore ├── cslib └── src │ └── main │ ├── java │ └── cslib │ │ ├── examples │ │ ├── SimpleWindowTestCloseEvent.java │ │ ├── SimpleWindowTestNonBlocking.java │ │ ├── SpriteTest.java │ │ ├── package-info.java │ │ └── turtle.png │ │ ├── fractal │ │ ├── MandelbrotGUI.java │ │ └── package-info.java │ │ ├── images │ │ ├── ImageFilter.java │ │ └── package-info.java │ │ ├── maze │ │ ├── Maze.java │ │ ├── maze1.png │ │ ├── maze2.png │ │ ├── maze3.png │ │ ├── maze4.png │ │ ├── maze5.png │ │ └── package-info.java │ │ ├── shapes │ │ ├── Shape.java │ │ ├── ShapeList.java │ │ └── package-info.java │ │ ├── square │ │ ├── Square.java │ │ └── package-info.java │ │ └── window │ │ ├── SimpleWindow.java │ │ ├── Sprite.java │ │ └── package-info.java │ └── resources │ ├── maze1.png │ ├── maze2.png │ ├── maze3.png │ ├── maze4.png │ ├── maze5.png │ └── turtle.png ├── introprog └── src │ ├── main │ └── scala │ │ └── introprog │ │ ├── BlockGame.scala │ │ ├── Dialog.scala │ │ ├── IO.scala │ │ ├── Image.scala │ │ ├── PixelWindow.scala │ │ ├── Swing.scala │ │ └── examples │ │ ├── TestBlockGame.scala │ │ ├── TestIO.scala │ │ └── TestPixelWindow.scala │ └── test │ └── scala │ └── testIO.scala ├── javatext ├── build.sbt ├── project │ └── build.properties └── src │ └── main │ ├── java │ └── game │ │ ├── Game.java │ │ └── Main.java │ └── scala │ └── game │ └── UserInterface.scala ├── w01_kojo ├── kojo.scala ├── timer1.sc └── timer2.sc ├── w02_programs ├── hello-app.scala └── hello-script.sc ├── w03_irritext ├── README.md └── irritext.scala ├── w04_blockmole ├── README.md └── hello-window.scala ├── w06_blockbattle ├── BlockWindow.scala ├── Game.scala ├── KeyControl.scala ├── Main.scala ├── Mole.scala ├── Pos.scala └── project.scala ├── w07_shuffle ├── Card.scala ├── Deck.scala ├── Hand.scala ├── PokerProbability.scala ├── README.md ├── TestDeck.scala ├── TestHand.scala └── project.scala ├── w08_life ├── Life.scala ├── LifeWindow.scala ├── Main.scala ├── Matrix.scala └── project.scala ├── w09_words ├── FreqMapBuilder.scala ├── Main.scala ├── Text.scala ├── gutenberg │ ├── inferno.txt │ ├── prideandprejudice.txt │ └── skattkammaron.txt └── project.scala ├── w10_snake ├── .gitignore ├── CanMove.scala ├── CanTeleport.scala ├── Colors.scala ├── Entity.scala ├── Main.scala ├── OnePlayerGame.scala ├── Player.scala ├── Settings.scala ├── Snake.scala ├── SnakeGame.scala ├── TwoPlayerGame.scala ├── pairs.scala └── project.scala ├── w13_bank_proj ├── bank_log.txt ├── project.scala └── src │ └── main │ └── scala │ └── bank │ ├── Bank.scala │ ├── BankAccount.scala │ ├── BankEvent.scala │ ├── Customer.scala │ ├── HistoryEntry.scala │ └── time │ └── Date.scala ├── w13_music_proj ├── project.scala └── src │ └── main │ └── scala │ └── music │ ├── Chord.scala │ ├── ChordPlayer.scala │ ├── Main.scala │ ├── Pitch.scala │ ├── Synth.scala │ ├── commands.scala │ └── instruments.scala └── w13_photo_proj ├── Button.scala ├── Filter.scala ├── ImageEditor.scala ├── Main.scala ├── Matrix.scala ├── images ├── boy.jpg ├── car.jpg ├── duck.jpg ├── jay.jpg ├── moon.jpg └── shuttle.jpg └── project.scala /about/course-experience-first-year/code/JPerson.java: -------------------------------------------------------------------------------- 1 | // this is Java 2 | 3 | public class JPerson { 4 | private String name; 5 | private int age; 6 | 7 | public JPerson(String n, int a) { 8 | name = n; 9 | age = a; 10 | } 11 | 12 | public JPerson(String n) { 13 | this(n, 42); 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public int getAge() { 21 | return age; 22 | } 23 | 24 | public void setAge(int a) { 25 | age = a; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /about/course-experience-first-year/code/Person.scala: -------------------------------------------------------------------------------- 1 | // this is idiomatic Scala 2 | 3 | case class Person( 4 | name: String, 5 | age: Int = 42 6 | ) 7 | -------------------------------------------------------------------------------- /about/course-experience-first-year/code/SPerson.scala: -------------------------------------------------------------------------------- 1 | // same in (non-idiomatic) Scala 2 | 3 | class SPerson(n: String, a: Int) { 4 | private var name: String = n 5 | private var age: Int = a 6 | 7 | def this (n: String): Unit = { 8 | this(n, 42) 9 | } 10 | 11 | def getName = name 12 | 13 | def getAge = age 14 | 15 | def setAge(a: Int): Unit = { 16 | age = a 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /about/course-experience-first-year/course-experiences.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/course-experiences.pdf -------------------------------------------------------------------------------- /about/course-experience-first-year/img/2015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/2015.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/2016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/2016.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/CEQ-2015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/CEQ-2015.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/CEQ-2016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/CEQ-2016.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/Q-exam-hard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/Q-exam-hard.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/Q-kontroll.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/Q-kontroll.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/Q-learn-quick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/Q-learn-quick.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/Q-learned.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/Q-learned.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/Q-scala.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/Q-scala.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/Q-tempo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/Q-tempo.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/grades-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/grades-2015.pdf -------------------------------------------------------------------------------- /about/course-experience-first-year/img/lang-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/lang-2015.pdf -------------------------------------------------------------------------------- /about/course-experience-first-year/img/lewisbook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/lewisbook.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/odersky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/odersky.png -------------------------------------------------------------------------------- /about/course-experience-first-year/img/pinsbook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/pinsbook.jpg -------------------------------------------------------------------------------- /about/course-experience-first-year/img/survey-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/course-experience-first-year/img/survey-2015.pdf -------------------------------------------------------------------------------- /about/scala-as-a-beginner-language/img/grades-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/scala-as-a-beginner-language/img/grades-2015.pdf -------------------------------------------------------------------------------- /about/scala-as-a-beginner-language/img/lang-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/scala-as-a-beginner-language/img/lang-2015.pdf -------------------------------------------------------------------------------- /about/scala-as-a-beginner-language/img/survey-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/scala-as-a-beginner-language/img/survey-2015.pdf -------------------------------------------------------------------------------- /about/scala-as-a-beginner-language/scala-first.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/scala-as-a-beginner-language/scala-first.pdf -------------------------------------------------------------------------------- /about/scala-intro-for-java-devs/code/JPerson.java: -------------------------------------------------------------------------------- 1 | // this is Java 2 | 3 | public class JPerson { 4 | private String name; 5 | private int age; 6 | 7 | public JPerson(String n, int a) { 8 | name = n; 9 | age = a; 10 | } 11 | 12 | public JPerson(String n) { 13 | this(n, 42); 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public int getAge() { 21 | return age; 22 | } 23 | 24 | public void setAge(int a) { 25 | age = a; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /about/scala-intro-for-java-devs/code/Person.scala: -------------------------------------------------------------------------------- 1 | // this is idiomatic Scala 2 | 3 | case class Person( 4 | name: String, 5 | age: Int = 42 6 | ) 7 | -------------------------------------------------------------------------------- /about/scala-intro-for-java-devs/code/SPerson.scala: -------------------------------------------------------------------------------- 1 | // same in (non-idiomatic) Scala 2 | 3 | class SPerson(n: String, a: Int) { 4 | private var name: String = n 5 | private var age: Int = a 6 | 7 | def this (n: String): Unit = { 8 | this(n, 42) 9 | } 10 | 11 | def getName = name 12 | 13 | def getAge = age 14 | 15 | def setAge(a: Int): Unit = { 16 | age = a 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /about/scala-intro-for-java-devs/img/odersky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/scala-intro-for-java-devs/img/odersky.png -------------------------------------------------------------------------------- /about/scala-intro-for-java-devs/scala-intro.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/about/scala-intro-for-java-devs/scala-intro.pdf -------------------------------------------------------------------------------- /compendium/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /compendium/cover/gurka.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/compendium/cover/gurka.jpg -------------------------------------------------------------------------------- /compendium/examples/Hi.java: -------------------------------------------------------------------------------- 1 | public class Hi { 2 | public static void main(String[] args) { 3 | System.out.println("Hello world!"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /compendium/examples/JComplexTest.java: -------------------------------------------------------------------------------- 1 | public class JComplexTest { 2 | public static void main(String[] args){ 3 | JComplex jc1 = new JComplex(3,4); 4 | String polar = "(" + jc1.getR() + ", " + jc1.getFi() + ")"; 5 | System.out.println("Polär form: " + polar); 6 | JComplex jc2 = new JComplex(1,2); 7 | System.out.println(jc1.add(jc2)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /compendium/examples/JPerson.java: -------------------------------------------------------------------------------- 1 | public class JPerson { 2 | private String name; 3 | private int age = 0; 4 | 5 | public JPerson(String name){ 6 | //namnkrock fixas med this 7 | this.name = name; 8 | } 9 | 10 | public String getName(){ 11 | return name; 12 | } 13 | 14 | public int getAge(){ 15 | return age; 16 | } 17 | 18 | public void setAge(int age){ 19 | this.age = age; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /compendium/examples/Match.scala: -------------------------------------------------------------------------------- 1 | object Match: 2 | def main(args: Array[String]): Unit = 3 | val favorite = if args.length > 0 then args(0) else "selleri" 4 | println("Din favoritgrönsak: " + favorite) 5 | val firstChar = favorite.toLowerCase.charAt(0) 6 | val meThink = firstChar match 7 | case 'g' => "gurka är gott!" 8 | case 't' => "tomat är gott!" 9 | case 'b' => "broccoli är gott!" 10 | case _ => s"$favorite är mindre gott..." 11 | println(s"Jag tycker att $meThink") 12 | -------------------------------------------------------------------------------- /compendium/examples/StringEqTest.java: -------------------------------------------------------------------------------- 1 | public class StringEqTest { 2 | public static void main(String[] args){ 3 | boolean eqTest1 = 4 | (new String("hej")) == (new String("hej")); 5 | boolean eqTest2 = 6 | (new String("hej")).equals(new String("hej")); 7 | int eqTest3 = 8 | (new String("hej")).compareTo(new String("hej")); 9 | System.out.println(eqTest1); 10 | System.out.println(eqTest2); 11 | System.out.println(eqTest3); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /compendium/examples/complex1.scala: -------------------------------------------------------------------------------- 1 | class Complex(val re: Double, val im: Double): 2 | def r = math.hypot(re, im) 3 | def fi = math.atan2(im, re) // motstående sida först 4 | def +(other: Complex) = new Complex(re + other.re, im + other.im) 5 | var imSymbol = 'i' 6 | override def toString = s"$re + $im$imSymbol" 7 | -------------------------------------------------------------------------------- /compendium/examples/complex2.scala: -------------------------------------------------------------------------------- 1 | class Complex(val re: Double, val im: Double): 2 | val r = math.hypot(re, im) 3 | val fi = math.atan2(im, re) 4 | def +(other: Complex) = new Complex(re + other.re, im + other.im) 5 | var imSymbol = 'i' 6 | override def toString = s"$re + $im$imSymbol" 7 | -------------------------------------------------------------------------------- /compendium/examples/complex3.scala: -------------------------------------------------------------------------------- 1 | class Complex private (val re: Double, val im: Double): 2 | def r = math.hypot(re, im) 3 | def fi = math.atan2(im, re) 4 | def +(other: Complex) = new Complex(re + other.re, im + other.im) 5 | var imSymbol = 'i' 6 | override def toString = s"$re + $im$imSymbol" 7 | -------------------------------------------------------------------------------- /compendium/examples/complex4.scala: -------------------------------------------------------------------------------- 1 | class Complex private (val re: Double, val im: Double): 2 | def r = math.hypot(re, im) 3 | def fi = math.atan2(im, re) 4 | def +(other: Complex) = new Complex(re + other.re, im + other.im) 5 | var imSymbol = 'i' 6 | override def toString = s"$re + $im$imSymbol" 7 | 8 | object Complex: 9 | def apply(re: Double, im: Double) = new Complex(re, im) // new behövs här 10 | def real(re: Double) = new Complex(re, 0) 11 | def imag(im: Double) = new Complex(0, im) 12 | -------------------------------------------------------------------------------- /compendium/examples/complex5.scala: -------------------------------------------------------------------------------- 1 | class Complex(val re: Double = 0, val im: Double = 0): 2 | def r = math.hypot(re, im) 3 | def fi = math.atan2(im, re) 4 | def +(other: Complex) = new Complex(re + other.re, im + other.im) 5 | var imSymbol = 'i' 6 | override def toString = s"$re + $im$imSymbol" 7 | -------------------------------------------------------------------------------- /compendium/examples/complex6.scala: -------------------------------------------------------------------------------- 1 | class Complex private (val re: Double, val im: Double): 2 | def r = math.hypot(re, im) 3 | def fi = math.atan2(im, re) 4 | def +(other: Complex) = new Complex(re + other.re, im + other.im) 5 | var imSymbol = 'i' 6 | override def toString = s"$re + $im$imSymbol" 7 | 8 | object Complex: 9 | def apply(re: Double = 0, im: Double = 0) = new Complex(re, im) 10 | def real(r: Double) = apply(re = r) 11 | def imag(i: Double) = apply(im = i) 12 | val zero = apply() 13 | -------------------------------------------------------------------------------- /compendium/examples/complex7.scala: -------------------------------------------------------------------------------- 1 | class Complex private (val re: Double, val im: Double): 2 | def r = math.hypot(re, im) 3 | def fi = math.atan2(im, re) 4 | def +(other: Complex) = new Complex(re + other.re, im + other.im) 5 | override def toString = s"$re + $im${Complex.imSymbol}" 6 | 7 | object Complex: 8 | var imSymbol = 'i' 9 | def apply(re: Double = 0, im: Double = 0) = new Complex(re, im) 10 | def real(r: Double) = apply(re = r) 11 | def imag(i: Double) = apply(im = i) 12 | val zero = apply() 13 | -------------------------------------------------------------------------------- /compendium/examples/diagonistic-test-2016/Bonus.scala: -------------------------------------------------------------------------------- 1 | object Bonus { 2 | def main(args: Array[String]): Unit = 3 | val lines = scala.io.Source.fromFile(args(0)).getLines.toVector 4 | val reg = new BonusRegister 5 | for line <- lines do 6 | val xs = line.split(' ') 7 | reg.add(studentId=xs(0), group=xs(1), points=xs(2).toInt) 8 | val bonusMap = reg.calculateBonus() 9 | val sortedPairs: Vector[(String, Int)] = bonusMap.toVector.sorted 10 | sortedPairs.foreach(println) 11 | } -------------------------------------------------------------------------------- /compendium/examples/diagonistic-test-2016/BonusRegister.scala: -------------------------------------------------------------------------------- 1 | /** A mutable register of individual points for bonus calculation */ 2 | class BonusRegister: 3 | /** Add data for one student */ 4 | def add(studentId: String, group: String, points: Int): Unit = ??? 5 | 6 | /** Returns an immutable Map with the bonus points of each studentId */ 7 | def calculateBonus(): Map[String, Int] = ??? 8 | object BonusRegister: 9 | /** Returns the average bonus calculated from a sequence of integers */ 10 | def collaborationBonus(points: Seq[Int]): Int = 11 | (points.sum / points.size.toDouble).round.toInt 12 | -------------------------------------------------------------------------------- /compendium/examples/diagonistic-test-2016/IdPrinter.scala: -------------------------------------------------------------------------------- 1 | object IdPrinter: 2 | import java.util.Random 3 | 4 | /** Prints n unique random integers within [min, max] in random order */ 5 | def print(rnd: Random, n: Int, min: Int, max: Int): Unit = ??? 6 | -------------------------------------------------------------------------------- /compendium/examples/diagonistic-test-2016/geometry.scala: -------------------------------------------------------------------------------- 1 | trait Movable: 2 | def move(dx: Double, dy: Double): Movable 3 | 4 | case class Point(x: Double = 0.0, y: Double = 0.0) extends Movable: 5 | def distanceTo(other: Point): Double = math.hypot(x - other.x, y - other.y) 6 | def move(dx: Double, dy: Double): Point = Point(x + dx, y + dy) 7 | 8 | case class Polygon(pts: Vector[Point]) extends Movable: 9 | def append(p: Point): Polygon = Polygon(pts :+ p) 10 | def move(dx: Double, dy: Double): Polygon = Polygon(pts.map(_.move(dx, dy))) 11 | object Polygon: 12 | def apply(pts: Point*): Polygon = new Polygon(pts.toVector) 13 | -------------------------------------------------------------------------------- /compendium/examples/diagonistic-test-2016/points.txt: -------------------------------------------------------------------------------- 1 | eko14def D01b 3 2 | eko14efg D02a 4 3 | eko14abc D01a 1 4 | dat16efg D01a 3 5 | dat16fgh D01b 4 6 | eko14cde D01b 5 7 | dat16def D01a 3 8 | dat16hij D02a 5 9 | dat16ijk D02a 0 10 | dat16cde D01a 2 -------------------------------------------------------------------------------- /compendium/examples/diagonistic-test-2016/solutions/IdPrinter.scala: -------------------------------------------------------------------------------- 1 | object IdPrinter: 2 | import java.util.Random 3 | 4 | def print(rnd: Random, n: Int, min: Int, max: Int): Unit = 5 | var taken = Set.empty[Int] 6 | while taken.size < n do 7 | val r = rnd.nextInt(max - min + 1) + min 8 | if !taken.contains(r) then 9 | println(r) 10 | taken += r 11 | 12 | -------------------------------------------------------------------------------- /compendium/examples/hello-indent.scala: -------------------------------------------------------------------------------- 1 | @main def run(): Unit = 2 | val message = "Hello world!" 3 | println(message) 4 | -------------------------------------------------------------------------------- /compendium/examples/hello-primitive-main.scala: -------------------------------------------------------------------------------- 1 | object Hello: 2 | def main(args: Array[String]): Unit = println("Hello world!") 3 | 4 | -------------------------------------------------------------------------------- /compendium/examples/hello-script.scala: -------------------------------------------------------------------------------- 1 | println("hejsan script") 2 | -------------------------------------------------------------------------------- /compendium/examples/hello.sc: -------------------------------------------------------------------------------- 1 | println("hejsan script") 2 | -------------------------------------------------------------------------------- /compendium/examples/hello.scala: -------------------------------------------------------------------------------- 1 | @main def run(): Unit = { 2 | val message = "Hello world!" 3 | println(message) 4 | } 5 | -------------------------------------------------------------------------------- /compendium/examples/index-of-min.scala: -------------------------------------------------------------------------------- 1 | def indexOfMin(xs: Array[Int]): Int = 2 | var minPos = 0 3 | var i = 1 4 | while i < xs.size do 5 | if xs(i) < xs(minPos) then 6 | minPos = i 7 | i += 1 8 | if xs.size > 0 then minPos else -1 9 | -------------------------------------------------------------------------------- /compendium/examples/localMutability.scala: -------------------------------------------------------------------------------- 1 | object localMutability: 2 | def kastaTärningTillsAllaUtfallUtomEtt(sidor: Int = 6): (Int, Set[Int]) = 3 | import scala.collection.mutable 4 | val s = mutable.Set.empty[Int] 5 | var n = 0 6 | while s.size < sidor - 1 do 7 | s += (math.random() * sidor + 1).toInt 8 | n += 1 9 | (n, s.toSet) 10 | 11 | def kastaImmutable(sidor: Int = 6): (Int, Set[Int]) = 12 | var s = Set.empty[Int] 13 | var n = 0 14 | while s.size < sidor - 1 do 15 | s += (math.random() * sidor + 1).toInt 16 | n += 1 17 | (n, s) 18 | -------------------------------------------------------------------------------- /compendium/examples/maxn.scala: -------------------------------------------------------------------------------- 1 | @main def maxn(args: String*): Unit = 2 | var max = Int.MinValue 3 | val n = args.length 4 | var i = 0 5 | while i < n do 6 | val x = args(i).toInt 7 | if x > max then 8 | max = x 9 | i += 1 10 | println(max) 11 | -------------------------------------------------------------------------------- /compendium/examples/maxn2.scala: -------------------------------------------------------------------------------- 1 | @main def maxn(args: String*): Unit = 2 | if args.size > 0 then 3 | var max = args(0).toInt 4 | val n = args.size 5 | var i = 0 6 | while i < n do 7 | val x = args(i).toInt 8 | if x > max then 9 | max = x 10 | i += 1 11 | println(max) 12 | else 13 | println("Empty") 14 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/JMain.java: -------------------------------------------------------------------------------- 1 | public class JMain { 2 | public static void main(String[] args){ 3 | System.out.println("Hello!"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/Main.scala: -------------------------------------------------------------------------------- 1 | object Main: 2 | def main(args: Array[String]): Unit = 3 | println("Hello!") 4 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/Point.scala: -------------------------------------------------------------------------------- 1 | class Point(val x: Int, val y: Int, save: Boolean = false): 2 | import Point.* 3 | 4 | if save then saved.prepend(this) 5 | 6 | def this() = this(0, 0) 7 | 8 | def distanceTo(that: Point) = distanceBetween(this, that) 9 | 10 | override def toString = s"Point($x, $y)" 11 | 12 | object Point: 13 | import scala.collection.mutable.{ArrayBuffer, Buffer} 14 | 15 | private val saved: Buffer[Point] = ArrayBuffer.empty 16 | 17 | def distanceBetween(p1: Point, p2: Point) = 18 | math.hypot(p1.x - p2.x, p1.y - p2.y) 19 | 20 | def showSaved: Unit = 21 | println(saved.mkString("Saved: ", ", ", "\n")) 22 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/generics/PointCanEquals.java: -------------------------------------------------------------------------------- 1 | class PointCanEquals extends Point { 2 | public PointCanEquals(int x, int y) { 3 | super(x, y); 4 | } 5 | 6 | @Override 7 | public boolean equals(Object obj) { 8 | if (obj instanceof Point) { 9 | Point p = (Point) obj; 10 | return getX() == p.getX() && getY() == p.getY(); 11 | } else { 12 | return false; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/generics/TestPitfall2.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | 3 | public class TestPitfall2 { 4 | 5 | public static void main(String[] args) { 6 | ArrayList list = new ArrayList(); 7 | for (int i=0; i<100; i++){ 8 | list.add(42); 9 | } 10 | int nbr = 99; 11 | int index = 0; 12 | list.add(nbr, index); // WRONG PARAM ORDER! Autoboxing in action. 13 | for (int elem: list){ 14 | System.out.println(elem); 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/generics/TestSet.java: -------------------------------------------------------------------------------- 1 | import java.util.Set; 2 | import java.util.HashSet; 3 | 4 | 5 | public class TestSet { 6 | public static void main(String[] args){ 7 | Set s = new HashSet(); 8 | s.add(42); 9 | s.add("hej"); 10 | System.out.println(s); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/list/Point.java: -------------------------------------------------------------------------------- 1 | public class Point { 2 | private int x; 3 | private int y; 4 | 5 | public Point(int x, int y){ 6 | this.x = x; 7 | this.y = y; 8 | }; 9 | 10 | public int getX(){ 11 | return x; 12 | }; 13 | 14 | public int getY(){ 15 | return y; 16 | }; 17 | 18 | public void move(int dx, int dy){ 19 | x += dx; 20 | y += dy; 21 | }; 22 | 23 | public double getDistanceTo(Point p) { 24 | int xDist = getX() - p.getX(); 25 | int yDist = getY() - p.getY(); 26 | return Math.sqrt(xDist * xDist + yDist * yDist); 27 | } 28 | 29 | public String toString() { 30 | return "Point [x=" + x + ", y=" + y + "]"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/list/build.sh: -------------------------------------------------------------------------------- 1 | javac -cp .:/home/bjornr/github/lunduniversity/introprog/lib/cslib.jar *.java 2 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/list/run.sh: -------------------------------------------------------------------------------- 1 | java -cp .:/home/bjornr/github/lunduniversity/introprog/lib/cslib.jar PolygonTest 2 | -------------------------------------------------------------------------------- /compendium/examples/scalajava/ortsnamn.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/compendium/examples/scalajava/ortsnamn.txt -------------------------------------------------------------------------------- /compendium/examples/sequences/Polygon.scala: -------------------------------------------------------------------------------- 1 | object Polygon: 2 | type Pt = (Int, Int) 3 | type Pts = Vector[Pt] 4 | def apply(pts: Pt*) = new Polygon(pts.toVector) 5 | 6 | case class Polygon(points: Polygon.Pts): 7 | import Polygon.Pt 8 | 9 | def size = points.size // for convenience but not really necessary (why?) 10 | 11 | def append(pts: Pt*): Polygon = copy(points ++ pts.toVector) 12 | 13 | def insert(pos: Int, pts: Pt*): Polygon = copy(points.patch(pos, pts, 0)) 14 | 15 | def remove(pos: Int, replaced: Int = 1): Polygon = 16 | copy(points.patch(pos, Seq(), replaced)) 17 | 18 | override def toString = points.mkString("Polygon(", "," ,")") 19 | -------------------------------------------------------------------------------- /compendium/examples/sequences/PolygonTest.scala: -------------------------------------------------------------------------------- 1 | object PolygonTest: 2 | val star = Array((100,180), (150,100), (180,180), (90,130), (200, 130)) 3 | val pw = new PolygonWindow(400,400) 4 | def main(args: Array[String]): Unit = pw.draw(star.toSeq) 5 | -------------------------------------------------------------------------------- /compendium/examples/sequences/PolygonWindow.scala: -------------------------------------------------------------------------------- 1 | class PolygonWindow(width: Int, height: Int): 2 | val w = new introprog.PixelWindow(width, height, title = "PolygonWindow") 3 | 4 | def draw(pts: Seq[(Int, Int)]): Unit = 5 | if pts.size > 0 then 6 | for i <- 1 until pts.size do 7 | w.line(pts(i - 1)._1, pts(i - 1)._2, pts(i)._1, pts(i)._2) 8 | val last = pts.length - 1 9 | w.line(pts(last)._1, pts(last)._2, pts(0)._1, pts(0)._2) 10 | -------------------------------------------------------------------------------- /compendium/examples/sequences/Timer.scala: -------------------------------------------------------------------------------- 1 | object Timer: 2 | private var startTime: Long = System.currentTimeMillis 3 | 4 | def elapsedMillis: Long = System.currentTimeMillis - startTime 5 | 6 | def reset: Unit = { startTime = System.currentTimeMillis } 7 | 8 | def measure[T](block: => T): (Long, T) = 9 | reset 10 | val result = block 11 | (elapsedMillis, result) 12 | -------------------------------------------------------------------------------- /compendium/examples/sequences/build.sbt: -------------------------------------------------------------------------------- 1 | scalaVersion := "3.2.2" 2 | libraryDependencies += "se.lth.cs" %% "introprog" % "1.2.0" 3 | -------------------------------------------------------------------------------- /compendium/examples/sequences/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /compendium/examples/sum-min-max.scala: -------------------------------------------------------------------------------- 1 | @main def sumMinMax(args: Int*): Unit = 2 | println(s"${args.sum} ${args.min} ${args.max}") 3 | -------------------------------------------------------------------------------- /compendium/examples/sum.sc: -------------------------------------------------------------------------------- 1 | val n = 1000 2 | val summa = (1 to n).sum 3 | println(s"Summan av de $n första talen är: $summa") 4 | -------------------------------------------------------------------------------- /compendium/examples/sum.scala: -------------------------------------------------------------------------------- 1 | @main def sum(args: String*): Unit = 2 | val n = 1000 3 | val summa = (1 to n).sum 4 | println(s"Summan av de $n första talen är: $summa") 5 | -------------------------------------------------------------------------------- /compendium/examples/sumn.scala: -------------------------------------------------------------------------------- 1 | @main def sumn(n: Int): Unit = 2 | var sum = 0 3 | var i = 1 4 | while i <= n do 5 | sum = sum + i 6 | i = i + 1 7 | println(sum) 8 | -------------------------------------------------------------------------------- /compendium/examples/swap-args.scala: -------------------------------------------------------------------------------- 1 | @main def swapFirstLastArg(args: String*): Unit = 2 | val xs = args.toArray 3 | if xs.length > 1 then 4 | val temp = xs(0) 5 | xs(0) = xs(xs.length - 1) 6 | xs(xs.length - 1) = temp 7 | println(xs.mkString(" ")) 8 | -------------------------------------------------------------------------------- /compendium/examples/workspace/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | # .project 3 | # .settings/ 4 | .metadata 5 | .recommenders 6 | .cache-main 7 | 8 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/build.sbt: -------------------------------------------------------------------------------- 1 | scalaVersion := "3.2.2" 2 | Compile/scalaSource := baseDirectory.value / "src" 3 | unmanagedBase := baseDirectory.value / "../../../../lib/" 4 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/Polygon.scala: -------------------------------------------------------------------------------- 1 | object Polygon: 2 | type Pt = (Int, Int) 3 | type Pts = Vector[Pt] 4 | def apply() = new Polygon(Vector()) 5 | 6 | import Polygon.{Pt, Pts} 7 | 8 | case class Polygon(points: Pts): 9 | def size = points.size // for convenience but not strictly necessary (why?) 10 | 11 | def append(pts: Pt*) = copy(points ++ pts.toVector) 12 | 13 | def insert(pos: Int, pts: Pt*) = copy(points.patch(pos, pts, 0)) 14 | 15 | def remove(pos: Int, replaced: Int = 1) = copy(points.patch(pos, Seq(), replaced)) 16 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/PolygonWindow.scala: -------------------------------------------------------------------------------- 1 | class PolygonWindow(width: Int, height: Int): 2 | val w = new cslib.window.SimpleWindow(width, height, "PolyWin") 3 | 4 | def draw(pts: Seq[(Int, Int)]): Unit = if pts.size > 0 then 5 | w.moveTo(pts(0)._1, pts(0)._2) 6 | for i <- 1 until pts.length do w.lineTo(pts(i)._1, pts(i)._2) 7 | w.lineTo(pts(0)._1, pts(0)._2) -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/Timer.scala: -------------------------------------------------------------------------------- 1 | object Timer: 2 | private var startTime: Long = System.currentTimeMillis 3 | 4 | def elapsedMillis: Long = System.currentTimeMillis - startTime 5 | 6 | def reset: Unit = 7 | startTime = System.currentTimeMillis 8 | 9 | def measure[T](block: => T): (Long, T) = 10 | reset 11 | val result = block 12 | (elapsedMillis, result) 13 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/polygonTest1.scala: -------------------------------------------------------------------------------- 1 | object polygonTest1: 2 | def main(args: Array[String]): Unit = 3 | val pw = new PolygonWindow(200,200) 4 | val pts = Array((0,0), (100,100), (50,100), (30,50)) 5 | pw.draw(pts.toSeq) 6 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/polygonTest2.scala: -------------------------------------------------------------------------------- 1 | object polygonTest2: 2 | def main(args: Array[String]): Unit = 3 | val pw = new PolygonWindow(200,200) 4 | val pts = Array((50,50), (100,100), (50,100), (30,50)) 5 | pw.draw(pts.toSeq) 6 | 7 | val morePts = pointSeqUtils.primitiveInsertCopy(pts, 2, (90,130)) 8 | //val morePts = pointSeqUtils.insertCopy(pts, 2, (90,130)) 9 | pw.draw(morePts.toSeq) 10 | 11 | val lessPts = pointSeqUtils.primitiveRemoveCopy(morePts, morePts.length - 1) 12 | //val lessPts = pointSeqUtils.removeCopy(morePts, morePts.length - 1) 13 | pw.draw(lessPts.toSeq) 14 | 15 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/polygonTest3.scala: -------------------------------------------------------------------------------- 1 | object polygonTest3: 2 | def main(args: Array[String]): Unit = 3 | val pw = new PolygonWindow(200,200) 4 | val poly = new PolygonArray(100) 5 | 6 | poly.append((50,50), (100,100), (50,100), (30,50)) 7 | println(poly) 8 | poly.draw(pw) 9 | 10 | poly.insert(2, (100,150)) 11 | println(poly) 12 | poly.draw(pw) 13 | 14 | poly.remove(0) 15 | println(poly) 16 | poly.draw(pw) 17 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/polygonTest4.scala: -------------------------------------------------------------------------------- 1 | object polygonTest4: 2 | def main(args: Array[String]): Unit = 3 | val pw = new PolygonWindow(200,200) 4 | val poly = new PolygonVector 5 | 6 | poly.append((50,50), (100,100), (50,100), (30,50)) 7 | println(poly) 8 | poly.draw(pw) 9 | 10 | poly.insert(2, (100,150)) 11 | println(poly) 12 | poly.draw(pw) 13 | 14 | poly.remove(0) 15 | println(poly) 16 | poly.draw(pw) 17 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/polygonTest5.scala: -------------------------------------------------------------------------------- 1 | object polygonTest5: 2 | def main(args: Array[String]): Unit = 3 | val pw = new PolygonWindow(200,200) 4 | var poly = Polygon() 5 | 6 | poly = poly.append((50,50), (100,100), (50,100), (30,50)) 7 | println(poly) 8 | pw.draw(poly.points) 9 | 10 | poly = poly.insert(2, (100,150)) 11 | println(poly) 12 | pw.draw(poly.points) 13 | 14 | poly = poly.remove(0) 15 | println(poly) 16 | pw.draw(poly.points) 17 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/seqCopy.scala: -------------------------------------------------------------------------------- 1 | object seqCopy: 2 | 3 | def arrayCopy(xs: Array[Int]): Array[Int] = 4 | val result = new Array[Int](xs.length) 5 | var i = 0 6 | while i < xs.length do 7 | result(i) = xs(i) 8 | i += 1 9 | result 10 | 11 | def test: String = 12 | val xs = Array(1,2,3,4,42) 13 | val ys = arrayCopy(xs) 14 | if xs sameElements ys then "OK!" else "ERROR!" 15 | 16 | def main(args: Array[String]): Unit = println(test) 17 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/seqCopyFor.scala: -------------------------------------------------------------------------------- 1 | object seqCopyFor: 2 | 3 | def arrayCopy(xs: Array[Int]): Array[Int] = 4 | val result = new Array[Int](xs.length) 5 | for i <- xs.indices do 6 | result(i) = xs(i) 7 | result 8 | 9 | def test: String = 10 | val xs = Array(1,2,3,4,42) 11 | val ys = arrayCopy(xs) 12 | if xs sameElements ys then "OK!" else "ERROR!" 13 | 14 | def main(args: Array[String]): Unit = println(test) 15 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w05-seqalg/src/seqCopyForYield.scala: -------------------------------------------------------------------------------- 1 | object seqCopyForYield: 2 | 3 | def arrayCopy(xs: Array[Int]): Array[Int] = 4 | val result = for i <- xs.indices yield xs(i) 5 | result.toArray 6 | 7 | def test: String = 8 | val xs = Array(1,2,3,4,42) 9 | val ys = arrayCopy(xs) 10 | if xs sameElements ys then "OK!" else "ERROR!" 11 | 12 | def main(args: Array[String]): Unit = println(test) 13 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/build.sbt: -------------------------------------------------------------------------------- 1 | scalaVersion := "3.2.2" 2 | Compile/scalaSource := baseDirectory.value / "src" 3 | //unmanagedBase := baseDirectory.value / "../../../../lib/" //old cslib 4 | libraryDependencies += "se.lth.cs" %% "introprog" % "1.2.0" 5 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/src/SimpleDrawingWindow.scala: -------------------------------------------------------------------------------- 1 | class SimpleDrawingWindow( 2 | title: String = "Untitled", 3 | size: (Int, Int) = (640, 400), 4 | ) extends 5 | introprog.PixelWindow(title = title, width = size._1, height = size._2) 6 | with DrawingWindow: 7 | 8 | private var penPos = (0.0, 0.0) 9 | 10 | override def penTo(pt: (Double, Double)): Unit = penPos = pt 11 | 12 | override def drawTo(pt: (Double, Double)): Unit = 13 | line(penPos._1.round.toInt, penPos._2.round.toInt, 14 | pt._1.round.toInt, pt._2.round.toInt) 15 | penPos = pt 16 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/src/draw.scala: -------------------------------------------------------------------------------- 1 | trait CanDraw: 2 | def draw(dw: DrawingWindow): Unit 3 | 4 | trait DrawingWindow: 5 | def penTo(pt: (Double, Double)): Unit 6 | def drawTo(pt: (Double, Double)): Unit 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/src/shapes2.scala: -------------------------------------------------------------------------------- 1 | object shapes2: 2 | type Pt = (Double, Double) 3 | 4 | trait Shape: 5 | def pos: Pt 6 | def move(dx: Double, dy: Double): Shape 7 | 8 | case class Rectangle(pos: Pt, dxy: Pt) extends Shape with CanDraw: // inmixning 9 | def move(dx: Double, dy: Double): Rectangle = 10 | Rectangle((pos._1 + dx, pos._2 + dy), dxy) 11 | 12 | def draw(dw: DrawingWindow): Unit = // implementation av draw 13 | dw.penTo(pos) 14 | dw.drawTo((pos._1 + dxy._1, pos._2)) 15 | dw.drawTo((pos._1 + dxy._1, pos._2 + dxy._2)) 16 | dw.drawTo((pos._1, pos._2 + dxy._2)) 17 | dw.drawTo(pos) 18 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/src/shapesTest1.scala: -------------------------------------------------------------------------------- 1 | import shapes1.* 2 | 3 | object shapesTest1: 4 | def main(args: Array[String]): Unit = 5 | val r = Rectangle(pos = (100, 100), dxy = (75, 120)) 6 | println(r) 7 | val r2 = r.move(dx = 42, dy = 84).move(dx = -1, dy = -1) 8 | println(r2) 9 | val t = Triangle((0,0),(4,0), (4,3)) 10 | println(t) 11 | println(t.move(1,1)) 12 | println(t) 13 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/src/shapesTest2.scala: -------------------------------------------------------------------------------- 1 | import shapes2.* 2 | 3 | object shapesTest2: 4 | def main(args: Array[String]): Unit = 5 | val sdw = new SimpleDrawingWindow(title="Shapes") 6 | val r = Rectangle(pos = (100, 100), dxy = (75, 120)) 7 | r.draw(sdw) 8 | r.move(dx=42, dy=84).draw(sdw) 9 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/src/vego1Test.scala: -------------------------------------------------------------------------------- 1 | import exempelVego1.* 2 | 3 | object vego1Test: 4 | def main(args: Array[String]): Unit = 5 | val g = new Gurka(200) 6 | val t = new Tomat(70) 7 | println(g) 8 | println(t) 9 | val gs = Vector(g, t) 10 | println(gs) 11 | gs.foreach(_.skala()) 12 | gs.foreach(println) 13 | -------------------------------------------------------------------------------- /compendium/examples/workspace/w07-inherit/src/vego2Test.scala: -------------------------------------------------------------------------------- 1 | import exempelVego2.* 2 | 3 | object vego2Test: 4 | def main(args: Array[String]): Unit = 5 | val g = new Gurka(200) 6 | val t = new Tomat(70) 7 | println(g) 8 | println(t) 9 | val gs = Vector(g, t) 10 | println(gs) 11 | gs.foreach(_.skala()) 12 | gs.foreach(println) 13 | -------------------------------------------------------------------------------- /compendium/generated/exercises-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \ExeRow{expressions} 3 | \ExeRow{programs} 4 | \ExeRow{functions} 5 | \ExeRow{objects} 6 | \ExeRow{classes} 7 | \ExeRow{patterns} 8 | \ExeRow{sequences} 9 | \ExeRow{matrices} 10 | \ExeRow{lookup} 11 | \ExeRow{inheritance} 12 | \ExeRow{context} 13 | \ExeRow{extra} 14 | \ExeRow{examprep} -------------------------------------------------------------------------------- /compendium/generated/labs-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium.tex 3 | \LabRow{kojo} 4 | \LabRow{irritext} 5 | \LabRow{blockmole} 6 | \LabRow{blockbattle0} 7 | \LabRow{blockbattle1} 8 | \LabRow{shuffle} 9 | \LabRow{life} 10 | \LabRow{words} 11 | \LabRow{snake0} 12 | \LabRow{snake1} -------------------------------------------------------------------------------- /compendium/generated/quiz-w01-intdiv-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code| 4 / 42 | & 1 & ~~\Large$\leadsto$~~ & F & \code| 0: Int | \\ 2 | \code| 42.0 / 2 | & 2 & ~~\Large$\leadsto$~~ & C & \code| 21.0: Double | \\ 3 | \code| 42 / 4 | & 3 & ~~\Large$\leadsto$~~ & B & \code| 10: Int | \\ 4 | \code| 42 % 4 | & 4 & ~~\Large$\leadsto$~~ & G & \code| 2: Int | \\ 5 | \code| 4 % 42 | & 5 & ~~\Large$\leadsto$~~ & A & \code| 4: Int | \\ 6 | \code| 40 % 4 == 0 | & 6 & ~~\Large$\leadsto$~~ & D & \code|true : Boolean | \\ 7 | \code| 42 % 4 == 0 | & 7 & ~~\Large$\leadsto$~~ & E & \code|false: Boolean | \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w01-intdiv-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code| 4 / 42 | & 1 & & A & \code| 4: Int | \\ 2 | \code| 42.0 / 2 | & 2 & & B & \code| 10: Int | \\ 3 | \code| 42 / 4 | & 3 & & C & \code| 21.0: Double | \\ 4 | \code| 42 % 4 | & 4 & & D & \code|true : Boolean | \\ 5 | \code| 4 % 42 | & 5 & & E & \code|false: Boolean | \\ 6 | \code| 40 % 4 == 0 | & 6 & & F & \code| 0: Int | \\ 7 | \code| 42 % 4 == 0 | & 7 & & G & \code| 2: Int | \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w01-types-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|1 | & 1 & & A & \code|String | \\ 2 | \code|1L | & 2 & & B & \code|Boolean| \\ 3 | \code|1.0 | & 3 & & C & \code|Boolean| \\ 4 | \code|1D | & 4 & & D & \code|Unit | \\ 5 | \code|1F | & 5 & & E & \code|Int | \\ 6 | \code|'1' | & 6 & & F & \code|Double | \\ 7 | \code|"1"| & 7 & & G & \code|Long | \\ 8 | \code|true | & 8 & & H & \code|Float | \\ 9 | \code|false| & 9 & & I & \code|Char | \\ 10 | \code|() | & 10 & & J & \code|Double | \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-array-vector-append-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | Vector & 1 & ~~\Large$\leadsto$~~ & B & varianter med fler/andra element skapas snabbt ur befintlig \\ 2 | Array & 2 & ~~\Large$\leadsto$~~ & A & långsam vid ändring av storlek (kopiering av rubbet krävs) \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-array-vector-append-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | Vector & 1 & & A & långsam vid ändring av storlek (kopiering av rubbet krävs) \\ 2 | Array & 2 & & B & varianter med fler/andra element skapas snabbt ur befintlig \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-array-vector-equality-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | Vector & 1 & ~~\Large$\leadsto$~~ & A & \code|xs == ys| är \code|true| om alla element lika \\ 2 | Array & 2 & ~~\Large$\leadsto$~~ & B & olikt andra Scala-samlingar kollar \code|==| ej innehållslikhet \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-array-vector-equality-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | Vector & 1 & & A & \code|xs == ys| är \code|true| om alla element lika \\ 2 | Array & 2 & & B & olikt andra Scala-samlingar kollar \code|==| ej innehållslikhet \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-array-vector-mutability-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | Vector & 1 & ~~\Large$\leadsto$~~ & B & oföränderlig \\ 2 | Array & 2 & ~~\Large$\leadsto$~~ & A & förändringsbar \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-array-vector-mutability-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | Vector & 1 & & A & förändringsbar \\ 2 | Array & 2 & & B & oföränderlig \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-for-yield-map-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|for x <- xs yield x * 2| & 1 & ~~\Large$\leadsto$~~ & A & \code|Vector(2, 4, 6)| \\ 2 | \code|for i <- xs.indices yield i| & 2 & ~~\Large$\leadsto$~~ & E & \code|Vector(0, 1, 2)| \\ 3 | \code|xs.map(x => x + 1) | & 3 & ~~\Large$\leadsto$~~ & D & \code|Vector(2, 3, 4)| \\ 4 | \code|for i <- 0 to 1 yield xs(i)| & 4 & ~~\Large$\leadsto$~~ & B & \code|Vector(1, 2)| \\ 5 | \code|(1 to 3).map(i => i)| & 5 & ~~\Large$\leadsto$~~ & C & \code|Vector(1, 2, 3)| \\ 6 | \code|(1 until 3).map(i => xs(i))| & 6 & ~~\Large$\leadsto$~~ & F & \code|Vector(2, 3)| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-for-yield-map-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|for x <- xs yield x * 2| & 1 & & A & \code|Vector(2, 4, 6)| \\ 2 | \code|for i <- xs.indices yield i| & 2 & & B & \code|Vector(1, 2)| \\ 3 | \code|xs.map(x => x + 1) | & 3 & & C & \code|Vector(1, 2, 3)| \\ 4 | \code|for i <- 0 to 1 yield xs(i)| & 4 & & D & \code|Vector(2, 3, 4)| \\ 5 | \code|(1 to 3).map(i => i)| & 5 & & E & \code|Vector(0, 1, 2)| \\ 6 | \code|(1 until 3).map(i => xs(i))| & 6 & & F & \code|Vector(2, 3)| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-hello-scala-java-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|def main| & 1 & ~~\Large$\leadsto$~~ & B & \jcode|public static void main| \\ 2 | \code|Array[String]| & 2 & ~~\Large$\leadsto$~~ & A & \jcode|String[]| \\ 3 | \code|Unit| & 3 & ~~\Large$\leadsto$~~ & C & \jcode|void| \\ 4 | \code|println| & 4 & ~~\Large$\leadsto$~~ & D & \jcode|System.out.println| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w02-hello-scala-java-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|def main| & 1 & & A & \jcode|String[]| \\ 2 | \code|Array[String]| & 2 & & B & \jcode|public static void main| \\ 3 | \code|Unit| & 3 & & C & \jcode|void| \\ 4 | \code|println| & 4 & & D & \jcode|System.out.println| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w03-code-fragments-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|options.indices| & 1 & & A & gör om en sträng till små bokstäver \\ 2 | \code|"1X2".toLowercase| & 2 & & B & heltalssekvens med alla index i en sekvens \\ 3 | \code|Random.nextInt(n)| & 3 & & C & slumptal i intervallet \code|0 until n| \\ 4 | \code|try { } catch { }| & 4 & & D & tar bort marginal till och med vertikalstreck \\ 5 | \code|""" ... """| & 5 & & E & fångar undantag för att förhindra krasch \\ 6 | \code|s.stripMargin| & 6 & & F & sträng som kan sträcka sig över flera kodrader \\ 7 | \code|e.printStackTrace| & 7 & & G & skriver ut information om ett undantag \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w03-function-values-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code| fleraAnrop(1, hälsa) | & 1 & ~~\Large$\leadsto$~~ & D & \code| f2("Hej!") | \\ 2 | \code| fleraAnrop(3, hälsa) | & 2 & ~~\Large$\leadsto$~~ & B & \code| fleraAnrop(3, f1) | \\ 3 | \code| fleraAnrop(2, f1) | & 3 & ~~\Large$\leadsto$~~ & A & \code| f2("Hej!\nHej!")| \\ 4 | \code| fleraAnrop(1, f3) | & 4 & ~~\Large$\leadsto$~~ & C & \code| f3() | \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w03-function-values-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code| fleraAnrop(1, hälsa) | & 1 & & A & \code| f2("Hej!\nHej!")| \\ 2 | \code| fleraAnrop(3, hälsa) | & 2 & & B & \code| fleraAnrop(3, f1) | \\ 3 | \code| fleraAnrop(2, f1) | & 3 & & C & \code| f3() | \\ 4 | \code| fleraAnrop(1, f3) | & 4 & & D & \code| f2("Hej!") | \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w03-lambda-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|(0 to 2).map(i => i + 1) | & 1 & ~~\Large$\leadsto$~~ & B & \code|(2 to 4).map(i => i - 1)| \\ 2 | \code|(1 to 3).map(_ + 1) | & 2 & ~~\Large$\leadsto$~~ & D & \code|Vector(2, 3, 4) | \\ 3 | \code|(2 to 4).map(math.pow(2, _)) | & 3 & ~~\Large$\leadsto$~~ & E & \code|Vector(4.0, 8.0, 16.0) | \\ 4 | \code|(3 to 5).map(math.pow(_, 2)) | & 4 & ~~\Large$\leadsto$~~ & A & \code|Vector(9.0, 16.0, 25.0) | \\ 5 | \code|(4 to 6).map(_.toDouble).map(_ / 2)| & 5 & ~~\Large$\leadsto$~~ & C & \code|Vector(2.0, 2.5, 3.0) | \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w03-lambda-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|(0 to 2).map(i => i + 1) | & 1 & & A & \code|Vector(9.0, 16.0, 25.0) | \\ 2 | \code|(1 to 3).map(_ + 1) | & 2 & & B & \code|(2 to 4).map(i => i - 1)| \\ 3 | \code|(2 to 4).map(math.pow(2, _)) | & 3 & & C & \code|Vector(2.0, 2.5, 3.0) | \\ 4 | \code|(3 to 5).map(math.pow(_, 2)) | & 4 & & D & \code|Vector(2, 3, 4) | \\ 5 | \code|(4 to 6).map(_.toDouble).map(_ / 2)| & 5 & & E & \code|Vector(4.0, 8.0, 16.0) | \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w03-yield-map-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|for i <- 1 to 3 yield öka(i)| & 1 & ~~\Large$\leadsto$~~ & E & \code|Vector(2, 3, 4)| \\ 2 | \code|Vector(2, 3, 4).map(i => öka(i))| & 2 & ~~\Large$\leadsto$~~ & A & \code|xs| \\ 3 | \code|xs.map(öka)| & 3 & ~~\Large$\leadsto$~~ & B & \code|Vector(4, 5, 6)| \\ 4 | \code|xs.map(öka).map(öka)| & 4 & ~~\Large$\leadsto$~~ & D & \code|Vector(5, 6, 7)| \\ 5 | \code|xs.foreach(öka)| & 5 & ~~\Large$\leadsto$~~ & C & \code|()| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w03-yield-map-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|for i <- 1 to 3 yield öka(i)| & 1 & & A & \code|xs| \\ 2 | \code|Vector(2, 3, 4).map(i => öka(i))| & 2 & & B & \code|Vector(4, 5, 6)| \\ 3 | \code|xs.map(öka)| & 3 & & C & \code|()| \\ 4 | \code|xs.map(öka).map(öka)| & 4 & & D & \code|Vector(5, 6, 7)| \\ 5 | \code|xs.foreach(öka)| & 5 & & E & \code|Vector(2, 3, 4)| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w05-case-class-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|val p1 = Pt(1, 2) | & 1 & ~~\Large$\leadsto$~~ & E & \code|Pt(1,2)| \\ 2 | \code|val p2 = Pt(y = 3) | & 2 & ~~\Large$\leadsto$~~ & C & \code|Pt(0,3)| \\ 3 | \code|val p3 = MutablePt(5, 6) | & 3 & ~~\Large$\leadsto$~~ & A & \code|MPt(5,6)| \\ 4 | \code|val p4 = Mutable() | & 4 & ~~\Large$\leadsto$~~ & D & \code|Not found| \\ 5 | \code|p2.moved(dx = 1) == Pt(1, 3) | & 5 & ~~\Large$\leadsto$~~ & F & \code|true| \\ 6 | \code|p3.move(dy = 1) == MutablePt(5, 7)| & 6 & ~~\Large$\leadsto$~~ & B & \code|false| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w05-case-class-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|val p1 = Pt(1, 2) | & 1 & & A & \code|MPt(5,6)| \\ 2 | \code|val p2 = Pt(y = 3) | & 2 & & B & \code|false| \\ 3 | \code|val p3 = MutablePt(5, 6) | & 3 & & C & \code|Pt(0,3)| \\ 4 | \code|val p4 = Mutable() | & 4 & & D & \code|Not found| \\ 5 | \code|p2.moved(dx = 1) == Pt(1, 3) | & 5 & & E & \code|Pt(1,2)| \\ 6 | \code|p3.move(dy = 1) == MutablePt(5, 7)| & 6 & & F & \code|true| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w05-class-arg-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|val p1 = Point3D() | & 1 & ~~\Large$\leadsto$~~ & C & \verb|p1: Point3D = Point3D@2eb37eee| \\ 2 | \code|val p2 = Point3D(y = 1) | & 2 & ~~\Large$\leadsto$~~ & F & \verb|p2: Point3D = Point3D@65a9e8d7| \\ 3 | \code|Point3D(z = 2).z | & 3 & ~~\Large$\leadsto$~~ & E & \code|value cannot be accessed| \\ 4 | \code|p2.y = 0 | & 4 & ~~\Large$\leadsto$~~ & B & \code|Reassignment to val| \\ 5 | \code|p2.y == 0 | & 5 & ~~\Large$\leadsto$~~ & A & \code|false| \\ 6 | \code|p1.x == Point3D().x | & 6 & ~~\Large$\leadsto$~~ & D & \code|true| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w05-class-arg-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|val p1 = Point3D() | & 1 & & A & \code|false| \\ 2 | \code|val p2 = Point3D(y = 1) | & 2 & & B & \code|Reassignment to val| \\ 3 | \code|Point3D(z = 2).z | & 3 & & C & \verb|p1: Point3D = Point3D@2eb37eee| \\ 4 | \code|p2.y = 0 | & 4 & & D & \code|true| \\ 5 | \code|p2.y == 0 | & 5 & & E & \code|value cannot be accessed| \\ 6 | \code|p1.x == Point3D().x | & 6 & & F & \verb|p2: Point3D = Point3D@65a9e8d7| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w05-class-param-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|val p1 = Point(1, 2) | & 1 & & A & \verb|missing argument for parameter| \\ 2 | \code|val p2 = Point() | & 2 & & B & \code|2| \\ 3 | \code|val p2 = Point(3, 4) | & 3 & & C & \verb|p1: Point = Point@30ef773e| \\ 4 | \code|p2.x - p1.x | & 4 & & D & \verb|too many arguments for constructor| \\ 5 | \code|Point(0, 1).y | & 5 & & E & \verb|p2: Point = Point@218cf600| \\ 6 | \code|Point(0, 1, 2) | & 6 & & F & \code|1| \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w07-seq-collections-solurows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|Vector | & 1 & ~~\Large$\leadsto$~~ & B & oföränderlig, ger snabbt godtyckligt ändrad samling \\ 2 | \code|List | & 2 & ~~\Large$\leadsto$~~ & C & oföränderlig, ger snabbt ny samling ändrad i början \\ 3 | \code|Array | & 3 & ~~\Large$\leadsto$~~ & D & primitiv, förändringsbar, snabb indexering, fix storlek \\ 4 | \code|ArrayBuffer| & 4 & ~~\Large$\leadsto$~~ & A & förändringsbar, snabb indexering, kan ändra storlek \\ 5 | \code|ListBuffer | & 5 & ~~\Large$\leadsto$~~ & E & förändringsbar, snabb att ändra i början \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w07-seq-collections-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | \code|Vector | & 1 & & A & förändringsbar, snabb indexering, kan ändra storlek \\ 2 | \code|List | & 2 & & B & oföränderlig, ger snabbt godtyckligt ändrad samling \\ 3 | \code|Array | & 3 & & C & oföränderlig, ger snabbt ny samling ändrad i början \\ 4 | \code|ArrayBuffer| & 4 & & D & primitiv, förändringsbar, snabb indexering, fix storlek \\ 5 | \code|ListBuffer | & 5 & & E & förändringsbar, snabb att ändra i början \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w08-concepts-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | matris & 1 & & A & indexerbar datastruktur i två dimensioner \\ 2 | radvektor & 2 & & B & har abstrakt typparameter, typen är generell \\ 3 | kolumnvektor & 3 & & C & annat ord för kolumn \\ 4 | kolonn & 4 & & D & konkret typ, binds till typparameter vid kompilering \\ 5 | generisk & 5 & & E & kompilatorn beräknar typ ur sammanhanget \\ 6 | typargument & 6 & & F & matris av dimension $1\times{}m$ med $m$ horisontella värden \\ 7 | typhärledning & 7 & & G & matris av dimension $m\times{}1$ med $m$ vertikala värden \\ -------------------------------------------------------------------------------- /compendium/generated/quiz-w09-concepts-taskrows-generated.tex: -------------------------------------------------------------------------------- 1 | mängd & 1 & & A & leta i sekvens tills sökkriteriet är uppfyllt \\ 2 | nyckel-värde-tabell & 2 & & B & avkoda symbolsekvens och återskapa objekt i minnet \\ 3 | mappning & 3 & & C & en unik identifierare \\ 4 | nyckel & 4 & & D & egenskapen att finnas kvar efter programmets avslut \\ 5 | persistens & 5 & & E & koda objekt till avkodningsbar sekvens av symboler \\ 6 | serialisera & 6 & & F & oordnad samling av mappningar med unika nycklar \\ 7 | de-serialisera & 7 & & G & \code|nyckel -> värde| \\ 8 | linjärsöka & 8 & & H & oordnad samling med unika element \\ -------------------------------------------------------------------------------- /compendium/generated/w06-chaphead-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \chapter{Mönster och felhantering}\label{chapter:W06} 3 | Begrepp som ingår i denna veckas studier: 4 | \begin{itemize}[noitemsep,label={$\square$},leftmargin=*] 5 | \item mönstermatchning 6 | \item match 7 | \item Option 8 | \item throw 9 | \item try 10 | \item catch 11 | \item Try 12 | \item unapply 13 | \item sealed 14 | \item flatten 15 | \item flatMap 16 | \item partiella funktioner 17 | \item collect 18 | \item wildcard-mönster 19 | \item variabelbindning i mönster 20 | \item sekvens-wildcard 21 | \item bokstavliga mönster 22 | \item implementera equals 23 | \item hashcode\end{itemize} 24 | -------------------------------------------------------------------------------- /compendium/generated/w08-chaphead-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \chapter{Nästlade och generiska strukturer}\label{chapter:W08} 3 | Begrepp som ingår i denna veckas studier: 4 | \begin{itemize}[noitemsep,label={$\square$},leftmargin=*] 5 | \item matris 6 | \item nästlad samling 7 | \item nästlad for-sats 8 | \item typparameter 9 | \item generisk funktion 10 | \item generisk klass 11 | \item fri och bunden typparameter 12 | \item generiska datastrukturer 13 | \item generiska samlingar i Scala\end{itemize} 14 | -------------------------------------------------------------------------------- /compendium/generated/w09-chaphead-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \chapter{Mängder och tabeller}\label{chapter:W09} 3 | Begrepp som ingår i denna veckas studier: 4 | \begin{itemize}[noitemsep,label={$\square$},leftmargin=*] 5 | \item innehållstest 6 | \item mängd 7 | \item Set 8 | \item mutable.Set 9 | \item nyckel-värde-tabell 10 | \item Map 11 | \item mutable.Map 12 | \item hash code 13 | \item java.util.HashMap 14 | \item java.util.HashSet 15 | \item persistens 16 | \item serialisering 17 | \item textfiler 18 | \item Source.fromFile 19 | \item java.nio.file\end{itemize} 20 | -------------------------------------------------------------------------------- /compendium/generated/w11-chaphead-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \chapter{Varians och kontextparametrar}\label{chapter:W11} 3 | Begrepp som ingår i denna veckas studier: 4 | \begin{itemize}[noitemsep,label={$\square$},leftmargin=*] 5 | \item övre- och undre typgräns 6 | \item varians 7 | \item kontravarians 8 | \item kovarians 9 | \item typjoker 10 | \item kontextgräns 11 | \item typkonstruktor 12 | \item egentyp 13 | \item typjoker 14 | \item givet värde (given) 15 | \item kontextparameter (using) 16 | \item ad hoc polymorfism 17 | \item typklass 18 | \item api 19 | \item kodläsbarhet 20 | \item granskningar\end{itemize} 21 | -------------------------------------------------------------------------------- /compendium/generated/w12-chaphead-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \chapter{Fördjupning, Projekt}\label{chapter:W12} 3 | Begrepp som ingår i denna veckas studier: 4 | \begin{itemize}[noitemsep,label={$\square$},leftmargin=*] 5 | \item välj valfritt fördjupningsområde 6 | \item påbörja projekt\end{itemize} 7 | -------------------------------------------------------------------------------- /compendium/generated/w13-chaphead-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \chapter{Repetition}\label{chapter:W13} 3 | Begrepp som ingår i denna veckas studier: 4 | \begin{itemize}[noitemsep,label={$\square$},leftmargin=*] 5 | \item träna på extentor 6 | \item redovisa projekt 7 | \item träna inför muntligt prov\end{itemize} 8 | -------------------------------------------------------------------------------- /compendium/generated/w14-chaphead-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \chapter{MUNTLIGT PROV}\label{chapter:W14} 3 | -------------------------------------------------------------------------------- /compendium/modules/w01-intro-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium1.tex 3 | 4 | \renewcommand{\vecka}{1} 5 | 6 | \input{generated/w01-chaphead-generated.tex} 7 | \clearpage\section{Teori} 8 | \input{../slides/body/lect-w01-intro.tex} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /compendium/modules/w02-programs-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium1.tex 3 | 4 | \renewcommand{\vecka}{2} 5 | 6 | \input{generated/w02-chaphead-generated.tex} 7 | \clearpage\section{Teori} 8 | \input{../slides/body/lect-w02-codestruct.tex} 9 | 10 | -------------------------------------------------------------------------------- /compendium/modules/w02-programs-lab.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium1.tex 3 | 4 | % INGEN LAB DENNA VECKA 5 | -------------------------------------------------------------------------------- /compendium/modules/w03-functions-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium1.tex 3 | 4 | \renewcommand{\vecka}{2} 5 | 6 | \input{generated/w03-chaphead-generated.tex} 7 | \clearpage\section{Teori} 8 | \input{../slides/body/lect-w03-functions.tex} 9 | -------------------------------------------------------------------------------- /compendium/modules/w04-objects-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium1.tex 3 | 4 | \input{generated/w04-chaphead-generated.tex} 5 | \clearpage\section{Teori} 6 | \input{../slides/body/lect-w04-objects.tex} 7 | -------------------------------------------------------------------------------- /compendium/modules/w05-classes-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium1.tex 4 | 5 | \input{generated/w05-chaphead-generated.tex} 6 | \clearpage\section{Teori} 7 | \input{../slides/body/lect-w05-classes.tex} 8 | \input{../slides/body/lect-w05-equality.tex} 9 | \input{../slides/body/lect-w05-case-classes.tex} 10 | \input{../slides/body/lect-w05-specifications.tex} 11 | -------------------------------------------------------------------------------- /compendium/modules/w05-classes-lab.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium1.tex 3 | 4 | % INGEN LAB DENNA VECKA 5 | 6 | \Lab{\LabWeekFIVE} 7 | 8 | \begin{Preparations} 9 | \item \DoExercise{\ExeWeekFIVE}{05}. 10 | \item Du har två veckor på dig att göra \texttt{blockbattle}. Läs redan nu igenom alla uppgifter i avsnitt \ref{section:lab:\LabWeekSIX}, men gör först grundövningarna innan du påbörjar labben, speciellt uppgift \ref{exe:classes:labprep} i denna veckas övningar. 11 | \end{Preparations} 12 | 13 | -------------------------------------------------------------------------------- /compendium/modules/w06-patterns-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium1.tex 4 | 5 | \input{generated/w06-chaphead-generated.tex} 6 | \clearpage\section{Teori} 7 | \input{../slides/body/lect-w06-assignments.tex} 8 | \input{../slides/body/lect-w06-matching.tex} 9 | \input{../slides/body/lect-w06-option.tex} 10 | \input{../slides/body/lect-w06-exceptions.tex} 11 | \input{../slides/body/lect-w06-equals.tex} 12 | -------------------------------------------------------------------------------- /compendium/modules/w07-sequences-lab-goals.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium1.tex 3 | 4 | \item Kunna skapa och använda sekvenssamlingar. 5 | \item Kunna implementera sekvensalgoritmen SHUFFLE som modifierar innehållet i en array på plats. 6 | \item Kunna registrera antalet förekomster av olika värden i en sekvens. 7 | -------------------------------------------------------------------------------- /compendium/modules/w08-matrices-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium2.tex 4 | 5 | \input{generated/w08-chaphead-generated.tex} 6 | \clearpage\section{Teori} 7 | \input{../slides/body/lect-w08-matrices.tex} 8 | \input{../slides/body/lect-w08-generics.tex} 9 | \input{../slides/body/lect-w08-ide.tex} 10 | -------------------------------------------------------------------------------- /compendium/modules/w09-setmap-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium2.tex 4 | 5 | \input{generated/w09-chaphead-generated.tex} 6 | \clearpage\section{Teori} 7 | %\input{../slides/body/lect-w09-diagnostic-test.tex} 8 | %\input{../slides/body/lect-w09-assigments.tex} 9 | \input{../slides/body/lect-w09-collections.tex} 10 | \input{../slides/body/lect-w09-serialize.tex} 11 | %\input{../slides/body/lect-w09-muddiest-point.tex} 12 | -------------------------------------------------------------------------------- /compendium/modules/w10-inheritance-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium1.tex 4 | 5 | \input{generated/w10-chaphead-generated.tex} 6 | \clearpage\section{Teori} 7 | \input{../slides/body/lect-w10-extends.tex} 8 | \input{../slides/body/lect-w10-override.tex} 9 | -------------------------------------------------------------------------------- /compendium/modules/w10-inheritance-lab-goals.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium2.tex 3 | 4 | \item Kunna använda arv. 5 | \item Kunna göra överskuggning av medlemmar i en supertyp. 6 | %\item Kunna referera till medlemmar i superklassen med \code{super} vid överskuggning. 7 | \item Kunna förklara begreppet dynamisk bindning. 8 | \item Kunna använda abstrakta klasser och skapa en klasshierarki. 9 | -------------------------------------------------------------------------------- /compendium/modules/w11-context-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium2.tex 4 | 5 | \input{generated/w11-chaphead-generated.tex} 6 | \clearpage\section{Teori} 7 | \input{../slides/body/lect-w11-context.tex} 8 | -------------------------------------------------------------------------------- /compendium/modules/w12-assignment-add-docs-task.tex: -------------------------------------------------------------------------------- 1 | Du ska inför redovisningen generera automatisk dokumentation baserat på dokumentationskommentarer enligt instruktioner i Appendix \ref{appendix:doc}. Du ska skriva relevanta dokumentationskommentarer för minst hälften av dina publika metoder. Det är ofta användbart att skriva dokumentationskommentarerna \emph{före} implementationen av metodkroppen. -------------------------------------------------------------------------------- /compendium/modules/w12-extra-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium2.tex 4 | 5 | \input{generated/w12-chaphead-generated.tex} 6 | \clearpage\section{Projektuppgift} 7 | % \input{../slides/body/lect-w12-algorithms.tex} 8 | % \input{../slides/body/lect-w12-search.tex} 9 | % \input{../slides/body/lect-w12-sort.tex} 10 | \input{../slides/body/lect-w12-project-assignment.tex} 11 | %\input{../slides/body/lect-w12-project-music.tex} 12 | -------------------------------------------------------------------------------- /compendium/modules/w13-examprep-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium2.tex 4 | 5 | \input{generated/w13-chaphead-generated.tex} 6 | \clearpage\section{Tips} 7 | \input{../slides/body/lect-w13-on-demand.tex} -------------------------------------------------------------------------------- /compendium/modules/w14-extra-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium2.tex 4 | 5 | \input{generated/w14-chaphead-generated.tex} 6 | 7 | \input{prechapters/oral-test.tex} 8 | -------------------------------------------------------------------------------- /compendium/modules/w14-extra-exercise.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../exercises.tex 3 | 4 | % \ifPreSolution 5 | 6 | % \Exercise{\ExeWeekFOURTEEN}\label{exe:W14} 7 | 8 | % \begin{Goals} 9 | % \end{Goals} 10 | 11 | % \begin{Preparations} 12 | % \item \StudyTheory{14} 13 | % \end{Preparations} 14 | 15 | % \else 16 | 17 | % \ExerciseSolution{\ExeWeekFOURTEEN} 18 | 19 | % \fi 20 | 21 | 22 | %%% EMPTY 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /compendium/modules/w14-extra-lab.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %%% EMPTY -------------------------------------------------------------------------------- /compendium/postchapters/java-chapter.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | %!TEX root = ../compendium2.tex 4 | 5 | \chapter{Introduktion till Java}\label{appendix:java} 6 | \clearpage\section{Teori} 7 | \input{../slides/body/lect-wjava-body.tex} 8 | -------------------------------------------------------------------------------- /compendium/postchapters/java.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium2.tex 3 | 4 | \input{postchapters/java-chapter.tex} 5 | \input{postchapters/java-exercise.tex} 6 | \input{postchapters/java-lab.tex} -------------------------------------------------------------------------------- /compendium/prechapters/course-architecture.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../compendium.tex 3 | 4 | \chapter{Kursens arkitektur} 5 | 6 | \input{../slides/body/lect-w01-about.tex} -------------------------------------------------------------------------------- /compendium/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /glossary/build.sbt: -------------------------------------------------------------------------------- 1 | ThisBuild/scalaVersion := "3.5.0" 2 | -------------------------------------------------------------------------------- /glossary/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.10.1 2 | -------------------------------------------------------------------------------- /img/abc80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/abc80.jpg -------------------------------------------------------------------------------- /img/ada.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/ada.jpg -------------------------------------------------------------------------------- /img/ankbok.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/ankbok.jpg -------------------------------------------------------------------------------- /img/annexet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/annexet.jpg -------------------------------------------------------------------------------- /img/block-xy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/block-xy.jpg -------------------------------------------------------------------------------- /img/blockbattle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/blockbattle.png -------------------------------------------------------------------------------- /img/blockmole-sky-grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/blockmole-sky-grass.png -------------------------------------------------------------------------------- /img/blockmole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/blockmole.png -------------------------------------------------------------------------------- /img/blockworm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/blockworm.png -------------------------------------------------------------------------------- /img/bomb-shelter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/bomb-shelter.jpg -------------------------------------------------------------------------------- /img/bonus-2016.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/bonus-2016.pdf -------------------------------------------------------------------------------- /img/boole.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/boole.jpg -------------------------------------------------------------------------------- /img/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/box.png -------------------------------------------------------------------------------- /img/brain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/brain.png -------------------------------------------------------------------------------- /img/bug.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/bug.jpg -------------------------------------------------------------------------------- /img/cat-vet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/cat-vet.jpg -------------------------------------------------------------------------------- /img/chords/ChordDraw.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/chords/ChordDraw.PNG -------------------------------------------------------------------------------- /img/chords/guitar-C-major-chord.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/chords/guitar-C-major-chord.jpg -------------------------------------------------------------------------------- /img/coffee-grinder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/coffee-grinder.jpg -------------------------------------------------------------------------------- /img/collection/collection-immutable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/collection/collection-immutable.png -------------------------------------------------------------------------------- /img/collection/collection-legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/collection/collection-legend.png -------------------------------------------------------------------------------- /img/collection/collection-mutable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/collection/collection-mutable.png -------------------------------------------------------------------------------- /img/collection/collection-traits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/collection/collection-traits.png -------------------------------------------------------------------------------- /img/compendium-cover-part1-2020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-cover-part1-2020.png -------------------------------------------------------------------------------- /img/compendium-cover-part1-2021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-cover-part1-2021.png -------------------------------------------------------------------------------- /img/compendium-cover-part1-2022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-cover-part1-2022.png -------------------------------------------------------------------------------- /img/compendium-cover-part2-2020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-cover-part2-2020.png -------------------------------------------------------------------------------- /img/compendium-cover-part2-2021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-cover-part2-2021.png -------------------------------------------------------------------------------- /img/compendium-cover-part2-2022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-cover-part2-2022.png -------------------------------------------------------------------------------- /img/compendium-front-page-2016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-front-page-2016.png -------------------------------------------------------------------------------- /img/compendium-front-page-2017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-front-page-2017.png -------------------------------------------------------------------------------- /img/compendium-front-page-2019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-front-page-2019.png -------------------------------------------------------------------------------- /img/compendium-front-page-part1-2018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/compendium-front-page-part1-2018.png -------------------------------------------------------------------------------- /img/crystal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/crystal.jpg -------------------------------------------------------------------------------- /img/dynamite.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/dynamite.jpg -------------------------------------------------------------------------------- /img/eclipse/eclipse-complete-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-complete-main.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-hello-world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-hello-world.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-import-existing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-import-existing.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-import-projects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-import-projects.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-import.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-open-perspective.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-open-perspective.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-perspective-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-perspective-button.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-pirates-hello.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-pirates-hello.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-scala-perspective.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-scala-perspective.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-select-workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-select-workspace.png -------------------------------------------------------------------------------- /img/eclipse/eclipse-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/eclipse-welcome.png -------------------------------------------------------------------------------- /img/eclipse/scalaide-import-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eclipse/scalaide-import-progress.png -------------------------------------------------------------------------------- /img/egg-box-closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/egg-box-closed.png -------------------------------------------------------------------------------- /img/egg-box.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/egg-box.jpg -------------------------------------------------------------------------------- /img/ehuset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/ehuset.jpg -------------------------------------------------------------------------------- /img/eniac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/eniac.jpg -------------------------------------------------------------------------------- /img/ericsson-buy-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/ericsson-buy-api.png -------------------------------------------------------------------------------- /img/frog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/frog.png -------------------------------------------------------------------------------- /img/fyll-rak-fel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/fyll-rak-fel.png -------------------------------------------------------------------------------- /img/fyll-rak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/fyll-rak.png -------------------------------------------------------------------------------- /img/glider-blinker-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/glider-blinker-block.png -------------------------------------------------------------------------------- /img/glider-gun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/glider-gun.png -------------------------------------------------------------------------------- /img/grace.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/grace.jpg -------------------------------------------------------------------------------- /img/graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/graph.pdf -------------------------------------------------------------------------------- /img/gurka-tomat-715x800.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/gurka-tomat-715x800.jpg -------------------------------------------------------------------------------- /img/gurka-tomat-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/gurka-tomat-small.jpg -------------------------------------------------------------------------------- /img/gurka.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/gurka.jpg -------------------------------------------------------------------------------- /img/hierarchy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/hierarchy.pdf -------------------------------------------------------------------------------- /img/highscore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/highscore.png -------------------------------------------------------------------------------- /img/ibm3090.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/ibm3090.jpg -------------------------------------------------------------------------------- /img/intellij/idea-complete-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-complete-main.png -------------------------------------------------------------------------------- /img/intellij/idea-hello.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-hello.png -------------------------------------------------------------------------------- /img/intellij/idea-import1-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import1-project.png -------------------------------------------------------------------------------- /img/intellij/idea-import2-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import2-select.png -------------------------------------------------------------------------------- /img/intellij/idea-import3-eclipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import3-eclipse.png -------------------------------------------------------------------------------- /img/intellij/idea-import4-directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import4-directory.png -------------------------------------------------------------------------------- /img/intellij/idea-import5-select-projects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import5-select-projects.png -------------------------------------------------------------------------------- /img/intellij/idea-import6-code-style.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import6-code-style.png -------------------------------------------------------------------------------- /img/intellij/idea-import6-select-SDK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import6-select-SDK.png -------------------------------------------------------------------------------- /img/intellij/idea-import7-setup-scala-sdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import7-setup-scala-sdk.png -------------------------------------------------------------------------------- /img/intellij/idea-import8-add-scala-support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import8-add-scala-support.png -------------------------------------------------------------------------------- /img/intellij/idea-import9-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-import9-run.png -------------------------------------------------------------------------------- /img/intellij/idea-new-hello-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-new-hello-project.png -------------------------------------------------------------------------------- /img/intellij/idea-new-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-new-project.png -------------------------------------------------------------------------------- /img/intellij/idea-new-scala-class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-new-scala-class.png -------------------------------------------------------------------------------- /img/intellij/idea-new-scala-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-new-scala-project.png -------------------------------------------------------------------------------- /img/intellij/idea-project-sdk-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-project-sdk-home.png -------------------------------------------------------------------------------- /img/intellij/idea-project-sdk-jvm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-project-sdk-jvm.png -------------------------------------------------------------------------------- /img/intellij/idea-scala-object.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-scala-object.png -------------------------------------------------------------------------------- /img/intellij/idea-scala-sdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-scala-sdk.png -------------------------------------------------------------------------------- /img/intellij/idea-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea-welcome.png -------------------------------------------------------------------------------- /img/intellij/idea1-complete-installation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/idea1-complete-installation.png -------------------------------------------------------------------------------- /img/intellij/import78-setup-scala-sdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/intellij/import78-setup-scala-sdk.png -------------------------------------------------------------------------------- /img/java-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/java-logo.png -------------------------------------------------------------------------------- /img/javadoc/javadoc-class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/javadoc/javadoc-class.png -------------------------------------------------------------------------------- /img/javadoc/javadoc-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/javadoc/javadoc-overview.png -------------------------------------------------------------------------------- /img/kids.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kids.jpg -------------------------------------------------------------------------------- /img/koffmanbook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/koffmanbook.jpg -------------------------------------------------------------------------------- /img/kojo-trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo-trace.png -------------------------------------------------------------------------------- /img/kojo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo.png -------------------------------------------------------------------------------- /img/kojo/color-circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/color-circles.png -------------------------------------------------------------------------------- /img/kojo/flowers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/flowers.png -------------------------------------------------------------------------------- /img/kojo/kojo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/kojo.png -------------------------------------------------------------------------------- /img/kojo/kvadrat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/kvadrat.png -------------------------------------------------------------------------------- /img/kojo/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/new.png -------------------------------------------------------------------------------- /img/kojo/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/play.png -------------------------------------------------------------------------------- /img/kojo/polygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/polygon.png -------------------------------------------------------------------------------- /img/kojo/polygons-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/polygons-circle.png -------------------------------------------------------------------------------- /img/kojo/race.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/race.png -------------------------------------------------------------------------------- /img/kojo/random-circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/random-circles.png -------------------------------------------------------------------------------- /img/kojo/random-color-circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/random-color-circles.png -------------------------------------------------------------------------------- /img/kojo/random-walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/random-walk.png -------------------------------------------------------------------------------- /img/kojo/square-column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/square-column.png -------------------------------------------------------------------------------- /img/kojo/square-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/square-grid.png -------------------------------------------------------------------------------- /img/kojo/square-param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/square-param.png -------------------------------------------------------------------------------- /img/kojo/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/square.png -------------------------------------------------------------------------------- /img/kojo/stairs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kojo/stairs.png -------------------------------------------------------------------------------- /img/kompetensbrist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/kompetensbrist.png -------------------------------------------------------------------------------- /img/lewisbook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/lewisbook.jpg -------------------------------------------------------------------------------- /img/linux-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/linux-terminal.png -------------------------------------------------------------------------------- /img/list.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/list.pdf -------------------------------------------------------------------------------- /img/logoLUeng.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/logoLUeng.pdf -------------------------------------------------------------------------------- /img/lulea-datacenter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/lulea-datacenter.jpg -------------------------------------------------------------------------------- /img/motivation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/motivation.png -------------------------------------------------------------------------------- /img/mutant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/mutant.png -------------------------------------------------------------------------------- /img/nobody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/nobody.png -------------------------------------------------------------------------------- /img/pet-carrier.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pet-carrier.jpg -------------------------------------------------------------------------------- /img/pinsbook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pinsbook.png -------------------------------------------------------------------------------- /img/pirates/args.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/args.png -------------------------------------------------------------------------------- /img/pirates/breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/breakpoint.png -------------------------------------------------------------------------------- /img/pirates/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/bug.png -------------------------------------------------------------------------------- /img/pirates/createobject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/createobject.png -------------------------------------------------------------------------------- /img/pirates/createproject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/createproject.png -------------------------------------------------------------------------------- /img/pirates/exekvera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/exekvera.png -------------------------------------------------------------------------------- /img/pirates/importproject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/importproject.png -------------------------------------------------------------------------------- /img/pirates/nameobject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/nameobject.png -------------------------------------------------------------------------------- /img/pirates/nameproject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/nameproject.png -------------------------------------------------------------------------------- /img/pirates/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/next.png -------------------------------------------------------------------------------- /img/pirates/selectscala.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/selectscala.png -------------------------------------------------------------------------------- /img/pirates/selectws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/selectws.png -------------------------------------------------------------------------------- /img/pirates/selectws2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pirates/selectws2.png -------------------------------------------------------------------------------- /img/plocklada.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/plocklada.png -------------------------------------------------------------------------------- /img/prompt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/prompt.jpg -------------------------------------------------------------------------------- /img/pypl-06-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pypl-06-20.png -------------------------------------------------------------------------------- /img/pypl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/pypl.jpg -------------------------------------------------------------------------------- /img/redmonk-Q122.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/redmonk-Q122.png -------------------------------------------------------------------------------- /img/redmonk-Q123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/redmonk-Q123.png -------------------------------------------------------------------------------- /img/redmonk-Q318.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/redmonk-Q318.png -------------------------------------------------------------------------------- /img/redmonk-Q320.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/redmonk-Q320.png -------------------------------------------------------------------------------- /img/redmonk-Q321.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/redmonk-Q321.png -------------------------------------------------------------------------------- /img/redmonk-Q619.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/redmonk-Q619.png -------------------------------------------------------------------------------- /img/scala-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scala-icon.png -------------------------------------------------------------------------------- /img/scala-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scala-logo.png -------------------------------------------------------------------------------- /img/scaladoc/scaladoc-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scaladoc/scaladoc-filter.png -------------------------------------------------------------------------------- /img/scaladoc/scaladoc-find-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scaladoc/scaladoc-find-fill.png -------------------------------------------------------------------------------- /img/scaladoc/scaladoc-mio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scaladoc/scaladoc-mio.png -------------------------------------------------------------------------------- /img/scaladoc/scaladoc-root-old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scaladoc/scaladoc-root-old.png -------------------------------------------------------------------------------- /img/scaladoc/scaladoc-root.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scaladoc/scaladoc-root.png -------------------------------------------------------------------------------- /img/scaladoc/scaladoc-vec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scaladoc/scaladoc-vec.png -------------------------------------------------------------------------------- /img/scaladoc/scaladoc-vector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/scaladoc/scaladoc-vector.png -------------------------------------------------------------------------------- /img/sigrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/sigrid.png -------------------------------------------------------------------------------- /img/snake-oneplayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/snake-oneplayer.png -------------------------------------------------------------------------------- /img/snake-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/snake-start.png -------------------------------------------------------------------------------- /img/snake-twoplayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/snake-twoplayer.png -------------------------------------------------------------------------------- /img/snurre-rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/snurre-rect.png -------------------------------------------------------------------------------- /img/stamp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/stamp.jpg -------------------------------------------------------------------------------- /img/survey-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey-2015.pdf -------------------------------------------------------------------------------- /img/survey-2020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey-2020.png -------------------------------------------------------------------------------- /img/survey-2021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey-2021.png -------------------------------------------------------------------------------- /img/survey-2022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey-2022.png -------------------------------------------------------------------------------- /img/survey-2023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey-2023.png -------------------------------------------------------------------------------- /img/survey-2024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey-2024.png -------------------------------------------------------------------------------- /img/survey/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey/bar.png -------------------------------------------------------------------------------- /img/survey/pie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/survey/pie.png -------------------------------------------------------------------------------- /img/tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/tree.pdf -------------------------------------------------------------------------------- /img/ttsuper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/ttsuper.png -------------------------------------------------------------------------------- /img/turtle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/turtle.png -------------------------------------------------------------------------------- /img/turtle/RectSeq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/turtle/RectSeq.png -------------------------------------------------------------------------------- /img/turtlerace/RaceWindow.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/turtlerace/RaceWindow.PNG -------------------------------------------------------------------------------- /img/ukulele.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/ukulele.jpg -------------------------------------------------------------------------------- /img/unplugged.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/unplugged.jpg -------------------------------------------------------------------------------- /img/vattenhallen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vattenhallen.png -------------------------------------------------------------------------------- /img/vm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vm.png -------------------------------------------------------------------------------- /img/vm2019-ehus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vm2019-ehus.png -------------------------------------------------------------------------------- /img/vm2019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vm2019.png -------------------------------------------------------------------------------- /img/vm2020-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vm2020-terminal.png -------------------------------------------------------------------------------- /img/vm2020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vm2020.png -------------------------------------------------------------------------------- /img/vscode-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vscode-debug.png -------------------------------------------------------------------------------- /img/vscode-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vscode-run.png -------------------------------------------------------------------------------- /img/vscode-trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/vscode-trace.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-13a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-13a.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-13b-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-13b-1.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-13b-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-13b-2.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-13b-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-13b-3.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-13c-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-13c-1.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-13c-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-13c-2.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-13c-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-13c-3.png -------------------------------------------------------------------------------- /img/w04-solutions/uppgift-3a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w04-solutions/uppgift-3a.png -------------------------------------------------------------------------------- /img/w05-hands/flush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/flush.png -------------------------------------------------------------------------------- /img/w05-hands/fours.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/fours.png -------------------------------------------------------------------------------- /img/w05-hands/fullhouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/fullhouse.png -------------------------------------------------------------------------------- /img/w05-hands/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/none.png -------------------------------------------------------------------------------- /img/w05-hands/pair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/pair.png -------------------------------------------------------------------------------- /img/w05-hands/straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/straight.png -------------------------------------------------------------------------------- /img/w05-hands/straightflush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/straightflush.png -------------------------------------------------------------------------------- /img/w05-hands/trips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/trips.png -------------------------------------------------------------------------------- /img/w05-hands/twopair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-hands/twopair.png -------------------------------------------------------------------------------- /img/w05-solutions/memory-pic-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-solutions/memory-pic-2.png -------------------------------------------------------------------------------- /img/w05-solutions/memory-pic-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-solutions/memory-pic-3.png -------------------------------------------------------------------------------- /img/w05-solutions/memory-pic-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-solutions/memory-pic-4.png -------------------------------------------------------------------------------- /img/w05-solutions/memory-pic-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-solutions/memory-pic-5.png -------------------------------------------------------------------------------- /img/w05-solutions/memory-pic-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w05-solutions/memory-pic-6.png -------------------------------------------------------------------------------- /img/w06-lab/RectangleSequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w06-lab/RectangleSequence.png -------------------------------------------------------------------------------- /img/w06-lab/RollingRectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w06-lab/RollingRectangle.png -------------------------------------------------------------------------------- /img/w06-solutions/1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w06-solutions/1b.png -------------------------------------------------------------------------------- /img/w06-solutions/2b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w06-solutions/2b.png -------------------------------------------------------------------------------- /img/w09-lab/AlgorithmVisualized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w09-lab/AlgorithmVisualized.png -------------------------------------------------------------------------------- /img/w09-lab/MazeAndMatrix.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w09-lab/MazeAndMatrix.jpg -------------------------------------------------------------------------------- /img/w09-lab/RandomMaze.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w09-lab/RandomMaze.jpg -------------------------------------------------------------------------------- /img/w09-solutions/1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w09-solutions/1a.png -------------------------------------------------------------------------------- /img/w11-lab/boarddiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w11-lab/boarddiagram.png -------------------------------------------------------------------------------- /img/w11-lab/lthopoly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w11-lab/lthopoly.png -------------------------------------------------------------------------------- /img/w12-assignment-photo/derivatabild2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/derivatabild2.pdf -------------------------------------------------------------------------------- /img/w12-assignment-photo/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/filter.png -------------------------------------------------------------------------------- /img/w12-assignment-photo/histo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/histo.pdf -------------------------------------------------------------------------------- /img/w12-assignment-photo/photo-duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/photo-duck.png -------------------------------------------------------------------------------- /img/w12-assignment-photo/photo-jay-sobel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/photo-jay-sobel.png -------------------------------------------------------------------------------- /img/w12-assignment-photo/photo-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/photo-main.png -------------------------------------------------------------------------------- /img/w12-assignment-photo/photo-xor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/photo-xor.png -------------------------------------------------------------------------------- /img/w12-assignment-photo/sobeljay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-assignment-photo/sobeljay.png -------------------------------------------------------------------------------- /img/w12-lab/glider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-lab/glider.png -------------------------------------------------------------------------------- /img/w12-lab/moore_neighborhood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-lab/moore_neighborhood.png -------------------------------------------------------------------------------- /img/w12-lab/quadtree_bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-lab/quadtree_bitmap.png -------------------------------------------------------------------------------- /img/w12-lab/wireworld_computer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w12-lab/wireworld_computer.png -------------------------------------------------------------------------------- /img/w14/most-loved-2016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w14/most-loved-2016.png -------------------------------------------------------------------------------- /img/w14/scala-dotty-roadmap-odersky.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w14/scala-dotty-roadmap-odersky.jpeg -------------------------------------------------------------------------------- /img/w14/scala-dotty-roadmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w14/scala-dotty-roadmap.png -------------------------------------------------------------------------------- /img/w14/scala-jobs-indeed-2017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w14/scala-jobs-indeed-2017.png -------------------------------------------------------------------------------- /img/w14/scala-jobs-sweden-linkedin-2017-dec07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/img/w14/scala-jobs-sweden-linkedin-2017-dec07.png -------------------------------------------------------------------------------- /lib/cslib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/lib/cslib.jar -------------------------------------------------------------------------------- /lib/workspace.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/lib/workspace.zip -------------------------------------------------------------------------------- /old/survey-preknowledge.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/old/survey-preknowledge.odt -------------------------------------------------------------------------------- /old/survey-preknowledge.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/old/survey-preknowledge.pdf -------------------------------------------------------------------------------- /old/tools/publish-tools.sh: -------------------------------------------------------------------------------- 1 | scp *.bat $LUCATID@fileadmin.cs.lth.se:/Websites/Fileadmin/pgk/. 2 | -------------------------------------------------------------------------------- /package.sh: -------------------------------------------------------------------------------- 1 | #workspace is published in repo (should be in release...) 2 | # sbt eclipse # deprecated, no support for scala-ide, use metals-eclipse plugin 3 | rm -i lib/workspace.zip 4 | zip -9 -r lib/workspace.zip -x="*target*" -x=*.class -x="workspace/project/*" -x="**/.*" -x="**/.scala-build" workspace 5 | 6 | # deprecated cslib will not change: 7 | # sbt cslib/package 8 | # cp workspace/cslib/target/scala-2.12/cslib_2.12-2017.2.jar lib/cslib.jar 9 | # for file in workspace/cslib/target/scala-2.12/cslib*.jar; do echo cp "$file" "lib/cslib.jar";done 10 | -------------------------------------------------------------------------------- /plan/build.sbt: -------------------------------------------------------------------------------- 1 | ThisBuild/scalaVersion := "3.5.0" 2 | -------------------------------------------------------------------------------- /plan/concepts/concepts.csv: -------------------------------------------------------------------------------- 1 | klass;class;En mall för att skapa objekt. Innehåller normalt attribut, metoder och konstruktorer.;Klass_(programmering);Class_(computer_programming) 2 | -------------------------------------------------------------------------------- /plan/concepts/concepts.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/plan/concepts/concepts.html -------------------------------------------------------------------------------- /plan/courseplan/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /plan/courseplan/publish-courseplan.sh: -------------------------------------------------------------------------------- 1 | latexmk courseplan.tex 2 | scp courseplan.pdf $LUCATID@fileadmin.cs.lth.se:/Websites/Fileadmin/pgk/. -------------------------------------------------------------------------------- /plan/ideas/chords.txt: -------------------------------------------------------------------------------- 1 | git:Em:0 2 2 0 0 0 2 | uku:D?:0 0 0 0 3 | error:XX:0 4 | -------------------------------------------------------------------------------- /plan/ideas/gettersetter.scala: -------------------------------------------------------------------------------- 1 | //gettersetter.scala 2 | 3 | class Box(var nbr: Int) 4 | 5 | class Box2(initNbr: Int) { 6 | private[this] var nbrInternal: Int = initNbr 7 | def nbr = nbrInternal 8 | def nbr_=(n: Int) { nbrInternal = n } 9 | } 10 | 11 | class Box3(initNbr: Int) { 12 | private[this] var nbrInternal: Double = initNbr 13 | def nbr = nbrInternal.toInt 14 | def nbr_=(n: Int) { nbrInternal = n } 15 | } -------------------------------------------------------------------------------- /plan/ideas/maze-simple.txt: -------------------------------------------------------------------------------- 1 | XXXXXXXXX 2 | X 3 | X XXXXXXX 4 | X X 5 | XXXXX XXX 6 | -------------------------------------------------------------------------------- /plan/ideas/spawn-thread.scala: -------------------------------------------------------------------------------- 1 | def spawn(codeBlock: => Unit) = { 2 | val t = new Thread(new Runnable { def run { codeBlock } }) 3 | t.start 4 | t 5 | } -------------------------------------------------------------------------------- /plan/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.10.1 2 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.10.1 2 | -------------------------------------------------------------------------------- /quickref/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /quickref/quickref-2.12/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /quickref/quickref-2.12/java-snabbref-booklet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[article, landscape, a4paper]{memoir} 2 | 3 | % Swedish. 4 | \usepackage[T1]{fontenc} 5 | \usepackage[swedish]{babel} 6 | 7 | \usepackage{pdfpages} 8 | 9 | %***************************************************************** 10 | \begin{document} 11 | \includepdf[pages=9-12, signature=4]{quickref.pdf} 12 | \end{document} -------------------------------------------------------------------------------- /quickref/quickref-2.12/quickref-booklet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[article, landscape, a4paper]{memoir} 2 | 3 | % Swedish. 4 | \usepackage[T1]{fontenc} 5 | \usepackage[swedish]{babel} 6 | 7 | \usepackage{pdfpages} 8 | 9 | %***************************************************************** 10 | \begin{document} 11 | \includepdf[pages=-, signature=4]{quickref.pdf} 12 | \end{document} -------------------------------------------------------------------------------- /quickref/quickref-2.13/java-snabbref-booklet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[article, landscape, a4paper]{memoir} 2 | 3 | % Swedish. 4 | \usepackage[T1]{fontenc} 5 | \usepackage[swedish]{babel} 6 | 7 | \usepackage{pdfpages} 8 | 9 | %***************************************************************** 10 | \begin{document} 11 | \includepdf[pages=9-12, signature=4]{quickref.pdf} 12 | \end{document} -------------------------------------------------------------------------------- /quickref/quickref-2.13/quickref-booklet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[article, landscape, a4paper]{memoir} 2 | 3 | % Swedish. 4 | \usepackage[T1]{fontenc} 5 | \usepackage[swedish]{babel} 6 | 7 | \usepackage{pdfpages} 8 | 9 | %***************************************************************** 10 | \begin{document} 11 | \includepdf[pages=-, signature=4]{quickref.pdf} 12 | \end{document} -------------------------------------------------------------------------------- /quickref/quickref-booklet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[article, landscape, a4paper]{memoir} 2 | 3 | % Swedish. 4 | \usepackage[T1]{fontenc} 5 | \usepackage[swedish]{babel} 6 | 7 | \usepackage{pdfpages} 8 | 9 | %***************************************************************** 10 | \begin{document} 11 | %%% NOTE: You must first comple quickref.tex into quicref.pdf 12 | %%% This file will generate booklet format for two-sided print from A4 to A5 13 | \includepdf[pages=-, booklet=true]{quickref.pdf} 14 | \end{document} -------------------------------------------------------------------------------- /quickref/quickref-double.tex: -------------------------------------------------------------------------------- 1 | \documentclass[article, landscape, a4paper]{memoir} 2 | 3 | % Swedish. 4 | \usepackage[T1]{fontenc} 5 | \usepackage[swedish]{babel} 6 | 7 | \usepackage{pdfpages} 8 | 9 | %***************************************************************** 10 | \begin{document} 11 | %%% NOTE: You must first comple quickref.tex into quicref.pdf 12 | %%% This file will generate landscape format with two pages side by side 13 | \includepdf[pages=-, nup=2x1,frame]{quickref.pdf} 14 | \end{document} -------------------------------------------------------------------------------- /quiz/build.sbt: -------------------------------------------------------------------------------- 1 | ThisBuild/scalaVersion := "3.5.0" 2 | -------------------------------------------------------------------------------- /quiz/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.10.1 2 | -------------------------------------------------------------------------------- /refs/ViktorsScalaOdyssey.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/refs/ViktorsScalaOdyssey.pdf -------------------------------------------------------------------------------- /refs/scala-2016.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/refs/scala-2016.pdf -------------------------------------------------------------------------------- /refs/scala-history.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/refs/scala-history.pdf -------------------------------------------------------------------------------- /show-scala-version.sh: -------------------------------------------------------------------------------- 1 | echo " *** scala versions in build.sbt ***" 2 | find . -type f -name build.sbt -exec grep -H "scalaVersion" {} \; 3 | 4 | echo " *** sbt versions in sbt.version ***" 5 | find . -type f -name build.properties -exec grep -H "sbt.version" {} \; 6 | #sed -i 's/scalaVersion := "3.0.1"/scalaVersion := "3.1.2"/g' workspace/*/build.sbt 7 | -------------------------------------------------------------------------------- /slides/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /slides/body/lect-preamble.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \setbeamertemplate{footline}[frame number] 3 | 4 | \input{../compendium/global-constants.tex} 5 | 6 | \title[Föreläsning i ''Programmering, grundkurs'', Björn Regnell, senast uppdaterad: \today]{Vecka \vecka. \veckotema} 7 | \subtitle{Programmering, grundkurs (pgk)} 8 | \author{Björn Regnell} 9 | \institute{Datavetenskap, LTH, Lunds universitet\\\url{https://cs.lth.se/pgk}} 10 | \date{EDAA45, Lp1-2, HT\CurrentYear\\{\vspace{1em}\tiny Kompilerad den \today}} 11 | 12 | \input{../compendium/generated/names-generated.tex} 13 | -------------------------------------------------------------------------------- /slides/body/lect-w07-assignments.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | %!TEX root = ../lect-w07.tex 3 | 4 | \ifkompendium\else 5 | 6 | \Subsection{Uppgifter denna vecka} 7 | 8 | \begin{Slide}{Denna veckas övning: \texttt{sequences}} 9 | \begin{itemize}\SlideFontTiny 10 | \input{../compendium/modules/w07-sequences-exercise-goals.tex} 11 | \end{itemize} 12 | \end{Slide} 13 | 14 | \begin{Slide}{Denna veckas laboration: \texttt{shuffle}} 15 | \begin{itemize}\SlideFontSmall 16 | \input{../compendium/modules/w07-sequences-lab-goals.tex} 17 | \end{itemize} 18 | \end{Slide} 19 | \fi 20 | -------------------------------------------------------------------------------- /slides/generated/w08-overview-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | Modul \Emph{Nästlade och generiska strukturer}: Övn \Alert{\texttt{matrices}} $\rightarrow$ Labb \Alert{\texttt{life}} 4 | \begin{multicols}{3}\SlideFontTiny 5 | $\square$ matris \\ 6 | $\square$ nästlad samling \\ 7 | $\square$ nästlad for-sats \\ 8 | $\square$ typparameter \\ 9 | $\square$ generisk funktion \\ 10 | $\square$ generisk klass \\ 11 | $\square$ fri och bunden typparameter \\ 12 | $\square$ generiska datastrukturer \\ 13 | $\square$ generiska samlingar i Scala \\ 14 | \end{multicols} 15 | -------------------------------------------------------------------------------- /slides/generated/w12-overview-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | Modul \Emph{Fördjupning, Projekt}: Övn \Alert{\texttt{extra}} $\rightarrow$ Labb \Alert{\texttt{Projekt0}} 4 | \begin{multicols}{3}\SlideFontTiny 5 | $\square$ välj valfritt fördjupningsområde \\ 6 | $\square$ påbörja projekt \\ 7 | \end{multicols} 8 | -------------------------------------------------------------------------------- /slides/generated/w13-overview-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | Modul \Emph{Repetition}: Övn \Alert{\texttt{examprep}} $\rightarrow$ Labb \Alert{\texttt{Projekt1}} 4 | \begin{multicols}{3}\SlideFontTiny 5 | $\square$ träna på extentor \\ 6 | $\square$ redovisa projekt \\ 7 | $\square$ träna inför muntligt prov \\ 8 | \end{multicols} 9 | -------------------------------------------------------------------------------- /slides/generated/w14-overview-generated.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | 3 | Modul \Emph{MUNTLIGT PROV}: Övn \Alert{\texttt{Munta}} $\rightarrow$ Labb \Alert{\texttt{Munta}} 4 | \begin{multicols}{3}\SlideFontTiny 5 | Repetera begrepp 6 | \end{multicols} 7 | -------------------------------------------------------------------------------- /slides/lect-w01.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | \renewcommand{\vecka}{1} 4 | \newcommand{\veckotema}{Introduktion} 5 | 6 | \input{body/lect-preamble.tex} 7 | 8 | \begin{document} 9 | 10 | \frame{\titlepage} 11 | \setnextsection{\vecka} 12 | \section[Vecka \vecka: Introduktion]{Introduktion} 13 | \frame{\tableofcontents} 14 | 15 | \input{body/lect-w01-about.tex} 16 | \input{body/lect-w01-intro.tex} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /slides/lect-w02.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{2} 5 | \newcommand{\veckotema}{Program och kontrollstrukturer} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w02-how-to-study.tex} 17 | \input{body/lect-w02-codestruct.tex} 18 | 19 | \end{document} 20 | -------------------------------------------------------------------------------- /slides/lect-w03.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{3} 5 | \newcommand{\veckotema}{Funktioner och abstraktion} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w03-course-ombudsmen.tex} 17 | \input{body/lect-w03-functions.tex} 18 | 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /slides/lect-w04.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{4} 5 | \newcommand{\veckotema}{Objekt och inkapsling} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w04-objects.tex} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /slides/lect-w06.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{6} 5 | \newcommand{\veckotema}{Mönster och felhantering} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w06-matching.tex} 17 | \input{body/lect-w06-option.tex} 18 | \input{body/lect-w06-exceptions.tex} 19 | \input{body/lect-w06-equals.tex} 20 | \input{body/lect-w06-assignments.tex} 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /slides/lect-w08.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{8} 5 | \newcommand{\veckotema}{Nästlade och generiska strukturer} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w08-reboot-camp.tex} 17 | \input{body/lect-w08-matrices.tex} 18 | \input{body/lect-w08-generics.tex} 19 | \input{body/lect-w08-ide.tex} 20 | 21 | \end{document} 22 | -------------------------------------------------------------------------------- /slides/lect-w09.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{9} 5 | \newcommand{\veckotema}{Mängder och tabeller} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w09-assigments.tex} 17 | \input{body/lect-w09-inspections.tex} 18 | \input{body/lect-w09-collections.tex} 19 | \input{body/lect-w09-serialize.tex} 20 | 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /slides/lect-w10.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{10} 5 | \newcommand{\veckotema}{Arv och komposition} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w10-extends.tex} 17 | \input{body/lect-w10-override.tex} 18 | \input{body/lect-w10-assignments.tex} 19 | 20 | %\input{body/lect-w10-shape.tex} 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /slides/lect-w11.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{11} 5 | \newcommand{\veckotema}{Varians och kontextparametrar} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w11-context.tex} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /slides/lect-w13.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{13} 5 | \newcommand{\veckotema}{Repetition} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w13-on-demand.tex} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /slides/lect-w14.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{14} 5 | \newcommand{\veckotema}{Avslutning} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-w14-final.tex} 17 | \end{document} 18 | -------------------------------------------------------------------------------- /slides/lect-wjava.tex: -------------------------------------------------------------------------------- 1 | %!TEX encoding = UTF-8 Unicode 2 | \documentclass{lecturenotes} 3 | 4 | \renewcommand{\vecka}{15} 5 | \newcommand{\veckotema}{Scala \& Java} 6 | 7 | \input{body/lect-preamble.tex} 8 | 9 | \begin{document} 10 | 11 | \frame{\titlepage} 12 | \setnextsection{\vecka} 13 | \section[Vecka \vecka: \veckotema]{\veckotema} 14 | \frame{\tableofcontents} 15 | 16 | \input{body/lect-wjava-body.tex} 17 | \end{document} 18 | -------------------------------------------------------------------------------- /slides/muddiest-point/muddiest-point-2016oct3.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/slides/muddiest-point/muddiest-point-2016oct3.ods -------------------------------------------------------------------------------- /slides/tabortmig.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/slides/tabortmig.txt -------------------------------------------------------------------------------- /study-groups/collaboration-contract.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/study-groups/collaboration-contract.pdf -------------------------------------------------------------------------------- /teachers/course-dev-2016/kickoff-2016march11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/teachers/course-dev-2016/kickoff-2016march11.pdf -------------------------------------------------------------------------------- /tests/kontroll2016okt25.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/tests/kontroll2016okt25.pdf -------------------------------------------------------------------------------- /tests/kontroll2017okt24.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/tests/kontroll2017okt24.pdf -------------------------------------------------------------------------------- /tests/solution2016okt25.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/tests/solution2016okt25.pdf -------------------------------------------------------------------------------- /tests/solution2017okt24.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/tests/solution2017okt24.pdf -------------------------------------------------------------------------------- /util/.gitignore: -------------------------------------------------------------------------------- 1 | lib/** 2 | apidoc/** 3 | -------------------------------------------------------------------------------- /util/build.sbt: -------------------------------------------------------------------------------- 1 | import sbt._ 2 | import Process._ 3 | import Keys._ 4 | 5 | libraryDependencies += "jline" % "jline" % "2.14.2" 6 | 7 | lazy val commonSettings = Seq( 8 | organization := "se.lth.cs", 9 | version := "16.1", 10 | scalaVersion := "3.2.2" 11 | ) 12 | 13 | lazy val util = (project in file(".")). 14 | settings(commonSettings: _*). 15 | settings( 16 | name := "util" 17 | ) 18 | 19 | 20 | -------------------------------------------------------------------------------- /util/doc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo scaladoc mio.scala -d apidoc 4 | scaladoc mio.scala -d apidoc 5 | -------------------------------------------------------------------------------- /util/fixexercise/build.sbt: -------------------------------------------------------------------------------- 1 | scalaVersion := "2.13.3" 2 | scalacOptions += "-deprecation" -------------------------------------------------------------------------------- /util/fixexercise/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /util/git-utils/delete-a-branch.sh: -------------------------------------------------------------------------------- 1 | git push origin --delete 2 | git branch -d 3 | git fetch --all --prune 4 | -------------------------------------------------------------------------------- /util/git-utils/scrap-all-pdfs.md: -------------------------------------------------------------------------------- 1 | # How to delete all pdfs from repo and reduce size of repo 2 | 3 | ## Checkout this and try it when you dare: 4 | 5 | * https://help.github.com/articles/removing-files-from-a-repository-s-history/ 6 | 7 | * http://stackoverflow.com/questions/14284370/remove-old-binary-revisions-from-git-and-reduce-size-of-git-repository 8 | -------------------------------------------------------------------------------- /util/prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # change CLASSDIR to correct path to compiled class files from prepend.scala: 4 | CLASSDIR="/home/bjornr/github/lunduniversity/introprog/util/target/scala-2.11/classes" 5 | scala -cp $CLASSDIR prepend 6 | -------------------------------------------------------------------------------- /util/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /util/repl-output-update-tool/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.watcherExclude": { 3 | "**/target": true 4 | } 5 | } -------------------------------------------------------------------------------- /util/repl-output-update-tool/README.md: -------------------------------------------------------------------------------- 1 | # Small fix to update all repl test-resources 2 | 3 | Made to fix this issue: 4 | https://github.com/lampepfl/dotty/issues/12981 -------------------------------------------------------------------------------- /util/repl-output-update-tool/build.sbt: -------------------------------------------------------------------------------- 1 | scalaVersion := "3.2.2" 2 | -------------------------------------------------------------------------------- /util/repl-output-update-tool/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.5.4 2 | -------------------------------------------------------------------------------- /web/build.sh: -------------------------------------------------------------------------------- 1 | pandoc -i tools/tools.md -o tools/tools.html 2 | -------------------------------------------------------------------------------- /web/encoding/intl.cpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/web/encoding/intl.cpl.png -------------------------------------------------------------------------------- /web/tools/adapter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/web/tools/adapter.jpg -------------------------------------------------------------------------------- /workspace-old/w05_turtle/.gitignore: -------------------------------------------------------------------------------- 1 | lib/* 2 | -------------------------------------------------------------------------------- /workspace-old/w05_turtle/compile.sh: -------------------------------------------------------------------------------- 1 | mkdir -p bin 2 | echo scalac -cp lib/cslib.jar -d bin src/main/scala/graphics/*.scala 3 | scalac -cp lib/cslib.jar -d bin src/main/scala/graphics/*.scala 4 | -------------------------------------------------------------------------------- /workspace-old/w05_turtle/download-cslib.sh: -------------------------------------------------------------------------------- 1 | mkdir -p lib 2 | wget -O lib/cslib.jar http://cs.lth.se/pgk/cslib 3 | -------------------------------------------------------------------------------- /workspace-old/w05_turtle/run.sh: -------------------------------------------------------------------------------- 1 | echo scala -cp "lib/cslib.jar:bin" graphics.Main 2 | scala -cp "lib/cslib.jar:bin" graphics.Main 3 | -------------------------------------------------------------------------------- /workspace-old/w05_turtle/src/main/scala/graphics/Main.scala: -------------------------------------------------------------------------------- 1 | package graphics 2 | 3 | import cslib.window.SimpleWindow 4 | 5 | object Main { 6 | def drawLine(p1: Point, p2: Point, w: SimpleWindow): Unit = { 7 | w.moveTo(p1.x.round.toInt, p1.y.round.toInt) 8 | w.lineTo(p2.x.round.toInt, p2.y.round.toInt) 9 | } 10 | 11 | def main(args: Array[String]): Unit = { 12 | val w = new SimpleWindow(500, 500, "Graphics") 13 | drawLine(Point(10.2,10.7), Point(300,300), w) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /workspace-old/w05_turtle/src/main/scala/graphics/Point.scala: -------------------------------------------------------------------------------- 1 | package graphics 2 | 3 | case class Point(x: Double, y: Double) 4 | -------------------------------------------------------------------------------- /workspace-old/w08_maze/src/main/scala/maze/MazeWalker.scala: -------------------------------------------------------------------------------- 1 | package maze 2 | 3 | import graphics.SimpleTurtle 4 | 5 | class MazeWalker(val turtle: SimpleTurtle) { 6 | private def delay(millis: Int) = Thread.sleep(millis) 7 | 8 | def walk(maze: Maze, animationDelay: Int): Unit = { 9 | println("*** Saknad implementation: gå i labyrint") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /workspace-old/w09_turtlerace_team/build.sbt: -------------------------------------------------------------------------------- 1 | trapExit := true 2 | -------------------------------------------------------------------------------- /workspace-old/w09_turtlerace_team/src/main/scala/turtlerace/ColorTurtle.scala: -------------------------------------------------------------------------------- 1 | package turtlerace 2 | 3 | import graphics.{Turtle, Point} 4 | import cslib.window.SimpleWindow 5 | import java.awt.Color 6 | 7 | class ColorTurtle( 8 | override val window: SimpleWindow, 9 | override val initPosition: Point = Point(0.0, 0.0), 10 | override val initDirection: Double = 0.0, 11 | val initColor: Color = Color.green 12 | ) extends Turtle(window, initPosition, initDirection, true) { 13 | var color = initColor 14 | 15 | /** Går length steg och ritar med color om isPenDown */ 16 | override def forward(length: Double): ColorTurtle = ??? 17 | } 18 | -------------------------------------------------------------------------------- /workspace-old/w09_turtlerace_team/src/main/scala/turtlerace/Main.scala: -------------------------------------------------------------------------------- 1 | package turtlerace 2 | 3 | object Main { 4 | def main(args : Array[String]): Unit = { 5 | println("TODO: ColorTurtle, RaceTurtle, TurtleRace") 6 | println("TODO: subtypes of RaceTurtle with different properties ") 7 | val rw = new RaceWindow() 8 | val tr = new TurtleRace() 9 | tr.race(Seq(), rw, "TODO TurtleRace") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /workspace-old/w09_turtlerace_team/src/main/scala/turtlerace/TurtleRace.scala: -------------------------------------------------------------------------------- 1 | package turtlerace 2 | 3 | import graphics.Turtle 4 | import cslib.window._ 5 | 6 | class TurtleRace(val millisPerStep: Int = 5) { 7 | def race( 8 | turtles: Seq[RaceTurtle], 9 | rw: RaceWindow, 10 | title: String 11 | ): Seq[RaceTurtle] = { 12 | rw.writeTitle("TurtleRace NOT READY") 13 | rw.draw() 14 | Seq() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /workspace-old/w10_music/build.sbt: -------------------------------------------------------------------------------- 1 | scalaVersion := "2.12.9" 2 | fork := true // https://stackoverflow.com/questions/18676712 3 | connectInput := true // http://www.scala-sbt.org/1.x/docs/Forking.html 4 | outputStrategy := Some(StdoutOutput) 5 | scalacOptions := Seq("-unchecked", "-deprecation") 6 | //libraryDependencies += "jline" % "jline" % "2.14.6" 7 | // https://repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar 8 | -------------------------------------------------------------------------------- /workspace-old/w10_music/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.16 2 | -------------------------------------------------------------------------------- /workspace-old/w10_music/src/main/scala/music/ChordPlayer.scala: -------------------------------------------------------------------------------- 1 | package music 2 | 3 | object ChordPlayer { 4 | 5 | case class Strike( 6 | velocity: Int = 50, // hur hårt anslag i Range(0, 128) 7 | duration: Long = 500, // hur länge i millisekunder 8 | spread: Long = 50, // millisekunder mellan tonerna 9 | after: Long = 0 // millisekunder innan första tonen 10 | ) 11 | 12 | def play(chord: Chord, strike: Strike = Strike(), channel: Int = 0): Unit = 13 | strike match { case Strike(v, d, s, a) => 14 | ??? 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /workspace-old/w10_music/src/main/scala/music/Main.scala: -------------------------------------------------------------------------------- 1 | package music 2 | 3 | object Main { 4 | val (helloMsg, exitMsg) = ("*** Welcome to music!", "Goodbye music!") 5 | def readLine(): String = scala.io.StdIn.readLine("music> ") 6 | 7 | def main(args: Array[String]): Unit = { 8 | println(helloMsg) 9 | Synth.playBlocking() 10 | Command.loopUntilExit(readLine _) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /workspace-old/w11_lthopoly_team/src/main/java/lthopoly/cards/MoneyCard.java: -------------------------------------------------------------------------------- 1 | package lthopoly.cards; 2 | 3 | /** 4 | * Created by Tank on 4/17/2016. 5 | */ 6 | public class MoneyCard { 7 | 8 | /** 9 | * Creates a new MoneyCard 10 | */ 11 | public MoneyCard(String description, int money) { 12 | } 13 | 14 | /** 15 | * Returns this card's money adjustment value 16 | */ 17 | public int getMoney() { 18 | return 0; 19 | } 20 | 21 | /** 22 | * Returns the description of why the money is adjusted 23 | */ 24 | public String getDescription() { 25 | return null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /workspace-old/w11_lthopoly_team/src/main/java/lthopoly/cards/MoveCard.java: -------------------------------------------------------------------------------- 1 | package lthopoly.cards; 2 | 3 | /** 4 | * Created by Tank on 4/17/2016. 5 | */ 6 | public class MoveCard { 7 | 8 | /** 9 | * Creates a new MoveCard 10 | */ 11 | public MoveCard(String description, int positionAdjustment) { 12 | } 13 | 14 | /** 15 | * Returns the position adjustment 16 | */ 17 | public int getPositionAdjustment() { 18 | return 0; 19 | } 20 | 21 | /** 22 | * Returns the description of why the position is adjusted 23 | */ 24 | public String getDescription() { 25 | return null; 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /workspace-old/w11_lthopoly_team/src/main/resources/board.txt: -------------------------------------------------------------------------------- 1 | House;20;Studiecentrum 2 | House;25;A-huset 3 | Money 4 | Money 5 | House;40;Moroten och piskan 6 | House;45;V-Huset 7 | Move 8 | Money 9 | House;70;LED-Cafe 10 | House;75;F-Huset 11 | Money 12 | Move 13 | House;80;Ideet 14 | Money 15 | House;100;E-huset 16 | Move -------------------------------------------------------------------------------- /workspace-old/w11_lthopoly_team/src/main/resources/movecards.txt: -------------------------------------------------------------------------------- 1 | Deadline för programmeringsprojekt! Flytta fram 6 steg;6 2 | En kompis gav dig sin gamla cykel! Flytta fram 4 steg;4 3 | Nu närmar sig tentaveckorna och du övernattar i skolan. Flytta bakåt 2 steg;-2 4 | Du har fått punka. Flytta bakåt 3 steg;-3 5 | Ny lägenhet nära skolan! Fytta fram 2 steg;2 6 | Dina kläder är blöta efter att ha badat i sjön-sjön och du måste gå hem. Flytta bakåt 5 steg;-5 -------------------------------------------------------------------------------- /workspace-old/w11_lthopoly_team/src/main/scala/lthopoly/Main.scala: -------------------------------------------------------------------------------- 1 | package lthopoly 2 | 3 | import lthopoly._ 4 | import scala.jdk.CollectionConverters._ 5 | 6 | object Main { 7 | def main(args: Array[String]): Unit = { 8 | 9 | } 10 | 11 | /** 12 | * Retrieves all possible actions from a GameBoard and joins 13 | * them with corresponding description Strings into tuples. 14 | * The tuples are then sent to the promptForInput method in TextUI. 15 | * 16 | * @return the user's choice as given by promptForInput. 17 | */ 18 | def getAction(board: GameBoard): Int = ??? 19 | 20 | } 21 | -------------------------------------------------------------------------------- /workspace-old/w12_survey/src/main/resources/out.csv: -------------------------------------------------------------------------------- 1 | Program,Indent,UI,Lang,OS,Browser,DE 2 | E,Spaces,Terminal,Java,Linux,Chromium,Eclipse 3 | F,Spaces,Terminal,C,Linux,Chrome,Emacs 4 | D,Tabs,GUI,C,Linux,Chrome,Gedit 5 | D,Spaces,GUI,C,Linux,Firefox,Vim 6 | F,Spaces,Terminal,C,Linux,Firefox,Vim -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/build.sbt: -------------------------------------------------------------------------------- 1 | ThisBuild/scalaVersion := "3.2.2" 2 | 3 | scalacOptions := Seq("-unchecked", "-deprecation") 4 | 5 | libraryDependencies += "se.lth.cs" %% "introprog" % "1.3.1" 6 | 7 | Compile/doc/javacOptions ++= Seq( 8 | "-encoding", "UTF-8", 9 | "-charset", "UTF-8", 10 | "-docencoding", "UTF-8" 11 | ) 12 | 13 | -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/images/boy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_img_proj/images/boy.jpg -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/images/car.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_img_proj/images/car.jpg -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/images/duck.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_img_proj/images/duck.jpg -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/images/jay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_img_proj/images/jay.jpg -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/images/moon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_img_proj/images/moon.jpg -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/images/shuttle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_img_proj/images/shuttle.jpg -------------------------------------------------------------------------------- /workspace-old/w13_img_proj/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/entities/entities.scala: -------------------------------------------------------------------------------- 1 | import models.{Matrix2D, ArrayMatrix2D} 2 | 3 | package object entities { 4 | val glider: Matrix2D = { 5 | // Glider will look like this: 6 | // 010 7 | // 001 8 | // 111 9 | 10 | val m = ArrayMatrix2D(3, 3) 11 | m.set(0, 1, 1) 12 | m.set(1, 2, 1) 13 | m.set(2, 0, 1) 14 | m.set(2, 1, 1) 15 | m.set(2, 2, 1) 16 | m 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/life.scala: -------------------------------------------------------------------------------- 1 | import models.{ArrayMatrix2D, Matrix2D} 2 | import rules.LifeRule 3 | import views.CellularGuiView 4 | 5 | 6 | // A setup with the standard Game of Life rule. 7 | object life { 8 | def main(args: Array[String]): Unit = { 9 | val boardSize = 40 10 | val matrix: Matrix2D = ArrayMatrix2D(boardSize, boardSize) 11 | matrix.randomize() 12 | 13 | CellularGuiView.useRule(LifeRule) 14 | CellularGuiView.display(matrix) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/rules/CyclicRule.scala: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import models._ 4 | 5 | // Implements the Cyclic cellular automaton. 6 | // https://en.wikipedia.org/wiki/Cyclic_cellular_automaton 7 | object CyclicRule extends Rule { 8 | def apply(m: Matrix2D, row: Int, col: Int): Int = ??? 9 | } -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/rules/LifeRule.scala: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import models._ 4 | 5 | // Implements the famous Game of Life rule. 6 | // https://en.wikipedia.org/wiki/Conway's_Game_of_Life 7 | object LifeRule extends Rule { 8 | def apply(m: Matrix2D, row: Int, col: Int): Int = ??? 9 | } -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/rules/NeighborsRule.scala: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import models._ 4 | 5 | // A rule that returns a matrix with the number of neighbors for every cell. 6 | // Useful in debugging. 7 | object NeighborsRule extends Rule { 8 | def apply(m: Matrix2D, row: Int, col: Int): Int = { 9 | val aliveNeighbors = m.mooreNeighborsStates(row, col).sum 10 | aliveNeighbors 11 | } 12 | } -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/rules/Rule.scala: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import models._ 4 | 5 | trait Rule { 6 | def apply(m: Matrix2D, row: Int, col: Int): Int 7 | } 8 | -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/rules/WireworldRule.scala: -------------------------------------------------------------------------------- 1 | package rules 2 | 3 | import models._ 4 | 5 | // Implements the Wireworld cellular automaton. 6 | // https://en.wikipedia.org/wiki/Wireworld 7 | object WireworldRule extends Rule { 8 | def apply(m: Matrix2D, row: Int, col: Int): Int = ??? 9 | } -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/utils/utils.scala: -------------------------------------------------------------------------------- 1 | package object utils { 2 | def timeit[R](block: => R): R = { 3 | val t0 = System.nanoTime() 4 | val result = block // call-by-name 5 | val t1 = System.nanoTime() 6 | println("Elapsed time: " + (t1 - t0)/1000/1000 + "ms") 7 | result 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/views/CellularConsoleView.scala: -------------------------------------------------------------------------------- 1 | package views 2 | 3 | import models.Matrix2D 4 | 5 | object CellularConsoleView extends CellularView2D { 6 | def display(m: Matrix2D): Unit = { 7 | println() 8 | for(i <- 0 until m.cols) { 9 | for(j <- 0 until m.rows) { 10 | if(m(i)(j) == 0) { 11 | print(" ") 12 | } else { 13 | print(m(i)(j) + " ") 14 | } 15 | } 16 | println() 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/views/CellularView2D.scala: -------------------------------------------------------------------------------- 1 | package views 2 | 3 | import models.Matrix2D 4 | 5 | trait CellularView2D { 6 | def display(m: Matrix2D) 7 | } 8 | 9 | -------------------------------------------------------------------------------- /workspace-old/w13_life/src/main/scala/wireworld.scala: -------------------------------------------------------------------------------- 1 | import javafx.scene.paint.Color 2 | 3 | import models.{ArrayMatrix2D, Matrix2D} 4 | import rules.WireworldRule 5 | import views.CellularGuiView 6 | 7 | 8 | // A setup with the Wireworld cellular automata. 9 | object wireworld { 10 | def main(args: Array[String]): Unit = { 11 | val states = 4 12 | val matrix: Matrix2D = ArrayMatrix2D(25, 25, states) 13 | 14 | CellularGuiView.useColors(Array(Color.BLACK, Color.BLUE, Color.RED, Color.YELLOW)) 15 | 16 | CellularGuiView.useRule(WireworldRule) 17 | CellularGuiView.display(matrix) 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/images/boy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_photo_proj_2022/images/boy.jpg -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/images/car.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_photo_proj_2022/images/car.jpg -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/images/duck.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_photo_proj_2022/images/duck.jpg -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/images/jay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_photo_proj_2022/images/jay.jpg -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/images/moon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_photo_proj_2022/images/moon.jpg -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/images/shuttle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace-old/w13_photo_proj_2022/images/shuttle.jpg -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.3 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Ysafe-init 3 | //> using lib se.lth.cs::introprog::1.3.1 4 | -------------------------------------------------------------------------------- /workspace-old/w13_photo_proj_2022/src/main/scala/Application.scala: -------------------------------------------------------------------------------- 1 | package photo 2 | 3 | object Application: 4 | 5 | /**Define filters*/ 6 | val filters : Array[ImageFilter] = ??? 7 | 8 | /**Ask for image, edit image etc*/ 9 | def main(args: Array[String]): Unit = ??? 10 | 11 | 12 | /**Ask if user wants to edit one more image or exit*/ 13 | private def continue: Boolean = ??? 14 | 15 | /**Get rid of text in terminal window*/ 16 | def clearScreen() = print("\u001b[2J\u001b[;H") 17 | -------------------------------------------------------------------------------- /workspace-old/w13_tabular/build.sbt: -------------------------------------------------------------------------------- 1 | ThisBuild/scalaVersion := "3.2.2" 2 | fork := true // https://stackoverflow.com/questions/18676712 3 | connectInput := true // http://www.scala-sbt.org/1.x/docs/Forking.html 4 | outputStrategy := Some(StdoutOutput) 5 | scalacOptions := Seq("-unchecked", "-deprecation") 6 | libraryDependencies += "se.lth.cs" %% "introprog" % "1.3.1" 7 | //libraryDependencies += "jline" % "jline" % "2.14.6" 8 | // https://repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar 9 | -------------------------------------------------------------------------------- /workspace-old/w13_tabular/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /workspace-old/w13_tabular/src/main/scala/tabular/Cell.scala: -------------------------------------------------------------------------------- 1 | package tabular 2 | import scala.util.{Try, Success, Failure} 3 | 4 | sealed trait Cell { def value: String } 5 | case class Str(value: String) extends Cell 6 | case class Num(num: BigDecimal) extends Cell { def value = num.toString } 7 | 8 | object Cell: 9 | /** Ger en Num om BigDecimal(s) lyckas annars en Str. */ 10 | def apply(s: String): Cell = ??? 11 | 12 | def apply(i: Int): Num = Num(BigDecimal(i)) 13 | 14 | def empty: Str = Str("") 15 | 16 | def zero: Num = Num(BigDecimal(0)) 17 | -------------------------------------------------------------------------------- /workspace-old/w13_tictactoe_proj/src/main/scala/tictactoe/HumanPlayer.scala: -------------------------------------------------------------------------------- 1 | class HumanPlayer(name: String) extends Player(name: String) { 2 | /** 3 | * Prints the name of the player, and asks via System.out what move the player wants to make. 4 | * Waits for an int p in the interval [0,8], where game(p) == 0, from System.in. 5 | * Returns p. 6 | */ 7 | def move(game: Array[Int], depth: Int): Int = ??? 8 | } -------------------------------------------------------------------------------- /workspace/.gitignore: -------------------------------------------------------------------------------- 1 | # Editor files 2 | ## VS Code 3 | **/.vscode 4 | ## Vim 5 | *.swp 6 | ## Emacs 7 | *~ 8 | 9 | # Java / Scala 10 | **/*.class 11 | **/.bloop 12 | **/.metals 13 | **/metals.sbt 14 | **/.bsp 15 | **/.scalafmt.conf 16 | **/.ammonite 17 | **/.scala-build 18 | 19 | # Eclipse 20 | **/*.cache-main 21 | **/.metadata 22 | **/.classpath 23 | **/.project 24 | 25 | # Sbt 26 | **/target 27 | 28 | # IntelliJ 29 | **/.idea 30 | -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/examples/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Programexempel. 3 | */ 4 | 5 | package cslib.examples; -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/examples/turtle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/java/cslib/examples/turtle.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/fractal/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Fraktaler (MandelbrotGUI). 3 | */ 4 | 5 | package cslib.fractal; 6 | 7 | -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/images/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Bildbehandling. 3 | */ 4 | 5 | package cslib.images; 6 | 7 | -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/maze/maze1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/java/cslib/maze/maze1.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/maze/maze2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/java/cslib/maze/maze2.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/maze/maze3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/java/cslib/maze/maze3.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/maze/maze4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/java/cslib/maze/maze4.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/maze/maze5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/java/cslib/maze/maze5.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/maze/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Labyrint (Maze). 3 | */ 4 | 5 | package cslib.maze; 6 | -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/shapes/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Geometriska figurer och lista av figurer (Shape och ShapeList). 3 | */ 4 | 5 | package cslib.shapes; 6 | 7 | -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/square/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Kvadrater (Square). 3 | */ 4 | 5 | package cslib.square; 6 | 7 | -------------------------------------------------------------------------------- /workspace/cslib/src/main/java/cslib/window/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Lättanvänt stöd för att skapa ritfönster. 3 | * 4 | * Innehåller klasserna SimpleWindow för att skapa ritfönster, 5 | * samt Sprite för att skapa flyttbara bilder i ett ritfönster. 6 | */ 7 | 8 | package cslib.window; 9 | 10 | -------------------------------------------------------------------------------- /workspace/cslib/src/main/resources/maze1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/resources/maze1.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/resources/maze2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/resources/maze2.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/resources/maze3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/resources/maze3.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/resources/maze4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/resources/maze4.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/resources/maze5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/resources/maze5.png -------------------------------------------------------------------------------- /workspace/cslib/src/main/resources/turtle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/cslib/src/main/resources/turtle.png -------------------------------------------------------------------------------- /workspace/javatext/build.sbt: -------------------------------------------------------------------------------- 1 | ThisBuild/scalaVersion := "3.2.2" 2 | scalacOptions := Seq("-unchecked", "-deprecation") 3 | Compile/doc/javacOptions ++= Seq( 4 | "-encoding", "UTF-8", 5 | "-charset", "UTF-8", 6 | "-docencoding", "UTF-8" 7 | ) 8 | 9 | -------------------------------------------------------------------------------- /workspace/javatext/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.8.2 2 | -------------------------------------------------------------------------------- /workspace/javatext/src/main/java/game/Game.java: -------------------------------------------------------------------------------- 1 | package game; 2 | 3 | public class Game { 4 | public Game(String playerName){ 5 | 6 | } 7 | 8 | public String getPlayerName(){ 9 | return ""; 10 | } 11 | 12 | public int getScore(){ 13 | return 0; 14 | } 15 | 16 | public void run(){ 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /workspace/javatext/src/main/scala/game/UserInterface.scala: -------------------------------------------------------------------------------- 1 | package game 2 | 3 | object UserInterface: 4 | /** Prints the available choices, then reads an integer from the user */ 5 | def readChoice(choices: Array[String]): Int = ??? 6 | 7 | /** Reads a string from the user */ 8 | def readString(): String = ??? 9 | 10 | /** Prints scores in descending order */ 11 | def showHighScores(scores: java.util.ArrayList[Game]): Unit = ??? 12 | 13 | /** Prints scores achieved by a specific player in descending order */ 14 | def showHighScores(scores: java.util.ArrayList[Game], player: String): Unit = ??? 15 | 16 | -------------------------------------------------------------------------------- /workspace/w01_kojo/kojo.scala: -------------------------------------------------------------------------------- 1 | //> using scala "3" 2 | //> using dep "net.kogics:kojo-lib:0.2.0,url=https://github.com/lunduniversity/introprog/releases/download/kojo-lib-0.2.0/kojo-lib-0.2.0.jar" 3 | 4 | export net.kogics.kojo.Swedish.*, padda.*, CanvasAPI.*, TurtleAPI.* 5 | export java.awt.Color 6 | -------------------------------------------------------------------------------- /workspace/w01_kojo/timer1.sc: -------------------------------------------------------------------------------- 1 | // paste into kojo or REPL or in REPL type `:load timer1.sc` 2 | 3 | 4 | object timer { 5 | def now: Long = System.currentTimeMillis 6 | var saved: Long = now 7 | def elapsedMillis: Long = now - saved 8 | def elapsedSeconds: Double = elapsedMillis / 1000.0 9 | def reset: Unit = { saved = now } 10 | } 11 | 12 | // HUVUDPROGRAM: 13 | 14 | timer.reset 15 | var i = 0L 16 | while (i < 1e8.toLong) { i += 1 } 17 | val t = timer.elapsedSeconds 18 | println(s"Räknade till $i på $t sekunder.") 19 | -------------------------------------------------------------------------------- /workspace/w02_programs/hello-app.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | 3 | @main def run = println("Hej Scala-app!") // en @main-funktion 4 | 5 | object Hello; 6 | def main(args: Array[String]): Unit = // en primitiv main-metod måste finnas i ett objekt 7 | println("Hej Scala-app med primitiv main!") 8 | -------------------------------------------------------------------------------- /workspace/w02_programs/hello-script.sc: -------------------------------------------------------------------------------- 1 | 2 | val msg = "Hejsan Scala-script!" 3 | println(msg) 4 | println("Ett Scala-script är en fil som slutar på .sc") 5 | println("I ett script behövs ingen @main") 6 | -------------------------------------------------------------------------------- /workspace/w04_blockmole/hello-window.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | 4 | import introprog.PixelWindow 5 | 6 | @main 7 | def run: Unit = 8 | println("HELLO main method! åäö ÅÄÖ") 9 | val w = new PixelWindow(width = 800, height = 600, title = "Hello Window!") 10 | w.drawText(x = 100, y = 200, text = "HELLO PIXEL WINDOW! ÅÄÖ åäö") 11 | introprog.examples.TestPixelWindow.main(Array()) 12 | 13 | -------------------------------------------------------------------------------- /workspace/w06_blockbattle/KeyControl.scala: -------------------------------------------------------------------------------- 1 | package blockbattle 2 | 3 | case class KeyControl(left: String, right: String, up: String, down: String): 4 | def direction(key: String): (Int, Int) = ??? 5 | 6 | def has(key: String): Boolean = ??? 7 | -------------------------------------------------------------------------------- /workspace/w06_blockbattle/Main.scala: -------------------------------------------------------------------------------- 1 | package blockbattle 2 | object Main: 3 | def main(args: Array[String]): Unit = 4 | val msg = "TODO: blockbattle" 5 | println(msg) 6 | val w = blockbattle.BlockWindow(nbrOfBlocks = (40,20)) 7 | w.write(msg, Pos(10,5), java.awt.Color.WHITE, 30) -------------------------------------------------------------------------------- /workspace/w06_blockbattle/Pos.scala: -------------------------------------------------------------------------------- 1 | package blockbattle 2 | 3 | case class Pos(x: Int, y: Int): 4 | def moved(delta: (Int, Int)): Pos = ??? 5 | -------------------------------------------------------------------------------- /workspace/w06_blockbattle/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | -------------------------------------------------------------------------------- /workspace/w07_shuffle/README.md: -------------------------------------------------------------------------------- 1 | Skriv följande kommando för att hantera flera huvudprogram: 2 | * `scala-cli run . --list-main-class` för att se alla huvudprogram 3 | * `scala-cli run . --main-class cards.PokerProbability` för att köra main-metoden i PokerProbability.scala, där cards är paketnamnet. -------------------------------------------------------------------------------- /workspace/w07_shuffle/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | -------------------------------------------------------------------------------- /workspace/w08_life/Main.scala: -------------------------------------------------------------------------------- 1 | package life 2 | 3 | object Main: 4 | val help = """ 5 | Welcome to GAME OF LIFE! 6 | 7 | Click on cell to toggle. 8 | Press ENTER for next generation. 9 | Press SPACE to toggle play/stop. 10 | Press R to create random life. 11 | Press BACKSPACE to clear life. 12 | Close window to exit. 13 | """ 14 | 15 | val dim = (30, 40) 16 | 17 | def main(args: Array[String]): Unit = 18 | println(help) 19 | //val w = new LifeWindow(dim._1, dim._2) 20 | //w.start() 21 | -------------------------------------------------------------------------------- /workspace/w08_life/Matrix.scala: -------------------------------------------------------------------------------- 1 | package life 2 | 3 | case class Matrix[T](data: Vector[Vector[T]]): 4 | require(data.forall(row => ???)) 5 | 6 | val dim: (Int, Int) = ??? 7 | 8 | def apply(row: Int, col: Int): T = ??? 9 | 10 | def updated(row: Int, col: Int)(value: T): Matrix[T] = ??? 11 | 12 | def foreachIndex(f: (Int, Int) => Unit): Unit = ??? 13 | 14 | override def toString = ??? 15 | 16 | object Matrix: 17 | def fill[T](dim: (Int, Int))(value: T): Matrix[T] = 18 | Matrix[T](Vector.fill(dim._1, dim._2)(value)) 19 | -------------------------------------------------------------------------------- /workspace/w08_life/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | -------------------------------------------------------------------------------- /workspace/w09_words/FreqMapBuilder.scala: -------------------------------------------------------------------------------- 1 | package nlp 2 | 3 | class FreqMapBuilder: 4 | private val register = collection.mutable.Map.empty[String, Int] 5 | def toMap: Map[String, Int] = register.toMap 6 | def add(s: String): Unit = ??? 7 | 8 | object FreqMapBuilder: 9 | /** Skapa ny FreqMapBuilder och räkna strängarna i xs */ 10 | def apply(xs: String*): FreqMapBuilder = ??? 11 | -------------------------------------------------------------------------------- /workspace/w09_words/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | -------------------------------------------------------------------------------- /workspace/w10_snake/.gitignore: -------------------------------------------------------------------------------- 1 | # Editor files 2 | ## VS Code 3 | **/.vscode 4 | ## Vim 5 | *.swp 6 | ## Emacs 7 | *~ 8 | 9 | # Java / Scala 10 | **/*.class 11 | **/.bloop 12 | **/.metals 13 | **/metals.sbt 14 | **/.bsp 15 | **/.scalafmt.conf 16 | **/.ammonite 17 | **/.scala-build 18 | 19 | # Eclipse 20 | **/*.cache-main 21 | **/.metadata 22 | **/.classpath 23 | **/.project 24 | 25 | # Sbt 26 | **/target 27 | 28 | # IntelliJ 29 | **/.idea 30 | -------------------------------------------------------------------------------- /workspace/w10_snake/CanMove.scala: -------------------------------------------------------------------------------- 1 | package snake 2 | 3 | trait CanMove extends Entity: 4 | def move(): Unit 5 | 6 | var movesPerSecond: Double = 20.0 7 | 8 | final def millisBetweenMoves: Int = 9 | (1000 / movesPerSecond).round.toInt max 1 10 | 11 | private var _timestampLastMove: Long = System.currentTimeMillis 12 | 13 | final def timestampLastMove = _timestampLastMove 14 | 15 | override final def update(): Unit = 16 | // flytta om tiden har gått millisBetweenMoves 17 | if System.currentTimeMillis > 18 | _timestampLastMove + millisBetweenMoves 19 | then 20 | _timestampLastMove = System.currentTimeMillis 21 | move() 22 | -------------------------------------------------------------------------------- /workspace/w10_snake/CanTeleport.scala: -------------------------------------------------------------------------------- 1 | package snake 2 | 3 | trait CanTeleport extends Entity: 4 | private var _pos = teleport() 5 | 6 | def pos: Pos = _pos 7 | 8 | protected var nbrOfStepsSinceLastTeleport = 0 9 | 10 | def teleportAfterSteps: Int 11 | 12 | def teleport(): Pos 13 | 14 | def update(): Unit = 15 | nbrOfStepsSinceLastTeleport += 1 16 | if nbrOfStepsSinceLastTeleport > teleportAfterSteps 17 | then reset() 18 | 19 | def reset(): Unit = 20 | nbrOfStepsSinceLastTeleport = 0 21 | _pos = teleport() 22 | 23 | -------------------------------------------------------------------------------- /workspace/w10_snake/Colors.scala: -------------------------------------------------------------------------------- 1 | package snake 2 | 3 | object Colors: 4 | import java.awt.Color 5 | val Red = Color.red 6 | val Green = Color(10,255,128) 7 | val Yellow = Color.yellow.brighter 8 | val DarkGreen = Color(10,255,128).darker 9 | val Blue = Color(10,128,255) 10 | val DarkBlue = Color(10,128,255).darker 11 | val Purple = Color(153,102,204) 12 | val DarkPurple = Color(153,102,204).darker 13 | val Pink = Color(242,128,161) 14 | val DarkPink = Color(242,128,161,100).darker 15 | val Black = Color.black 16 | val DarkGray = Color.gray.darker.darker -------------------------------------------------------------------------------- /workspace/w10_snake/Entity.scala: -------------------------------------------------------------------------------- 1 | package snake 2 | 3 | trait Entity: 4 | def draw(): Unit 5 | 6 | def erase(): Unit 7 | 8 | def update(): Unit 9 | 10 | def reset(): Unit 11 | 12 | infix def isOccupyingBlockAt(p: Pos): Boolean 13 | -------------------------------------------------------------------------------- /workspace/w10_snake/OnePlayerGame.scala: -------------------------------------------------------------------------------- 1 | package snake 2 | 3 | class OnePlayerGame: // ska ärva SnakeGame 4 | 5 | // orm, äpple, ev. bananer etc 6 | 7 | def play(playerNames: String*): Unit = ??? // ska överskugga play i SnakeGame 8 | -------------------------------------------------------------------------------- /workspace/w10_snake/Player.scala: -------------------------------------------------------------------------------- 1 | package snake 2 | 3 | class Player( 4 | var name: String, 5 | var keyMap: Player.KeyMap, 6 | val snake: Snake, 7 | var points: Int = 0, // TODO: count points when e.g. eating apple 8 | ): 9 | def handleKey(key: String): Unit = 10 | ??? // om key ingår i keyMap så uppdatera snake.dir 11 | 12 | object Player: 13 | enum KeyMap(left: String, right: String, up: String, down: String): 14 | val dir = Map(left -> West, right -> East, up -> North, down -> South) 15 | case Letters extends KeyMap("a", "d", "w", "s") 16 | case Arrows extends KeyMap("Left", "Right", "Up", "Down") -------------------------------------------------------------------------------- /workspace/w10_snake/TwoPlayerGame.scala: -------------------------------------------------------------------------------- 1 | package snake 2 | 3 | class TwoPlayerGame: // ska ärva SnakeGame 4 | 5 | // ormar och ev. äpple, bananer etc 6 | 7 | def play(playerNames: String*): Unit = ??? // ska överskugga play i SnakeGame 8 | -------------------------------------------------------------------------------- /workspace/w10_snake/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | -------------------------------------------------------------------------------- /workspace/w13_bank_proj/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | -------------------------------------------------------------------------------- /workspace/w13_bank_proj/src/main/scala/bank/Customer.scala: -------------------------------------------------------------------------------- 1 | package bank 2 | 3 | /** 4 | * A customer of a bank with provided name and id. 5 | */ 6 | case class Customer(name: String, id: Long): 7 | override def toString(): String = ??? -------------------------------------------------------------------------------- /workspace/w13_music_proj/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | -------------------------------------------------------------------------------- /workspace/w13_music_proj/src/main/scala/music/ChordPlayer.scala: -------------------------------------------------------------------------------- 1 | package music 2 | 3 | object ChordPlayer: 4 | 5 | case class Strike( 6 | velocity: Int = 50, // hur hårt anslag i Range(0, 128) 7 | duration: Long = 500, // hur länge i millisekunder 8 | spread: Long = 50, // millisekunder mellan tonerna 9 | after: Long = 0 // millisekunder innan första tonen 10 | ) 11 | 12 | def play(chord: Chord, strike: Strike = Strike(), channel: Int = 0): Unit = 13 | strike match 14 | case Strike(v, d, s, a) => ??? 15 | 16 | -------------------------------------------------------------------------------- /workspace/w13_music_proj/src/main/scala/music/Main.scala: -------------------------------------------------------------------------------- 1 | package music 2 | 3 | object Main: 4 | val (helloMsg, exitMsg) = ("*** Welcome to music!", "Goodbye music!") 5 | def readLine(): String = scala.io.StdIn.readLine("music> ") 6 | 7 | def main(args: Array[String]): Unit = 8 | println(helloMsg) 9 | Synth.playBlocking() 10 | Command.loopUntilExit(readLine _) 11 | -------------------------------------------------------------------------------- /workspace/w13_photo_proj/ImageEditor.scala: -------------------------------------------------------------------------------- 1 | package photo 2 | 3 | import introprog.Image 4 | 5 | class ImageEditor(im: Image, initPath: String): 6 | var history: Vector[Image] = Vector(im) 7 | 8 | // TODO; use PixelWindow to implement gui -------------------------------------------------------------------------------- /workspace/w13_photo_proj/Matrix.scala: -------------------------------------------------------------------------------- 1 | package photo 2 | 3 | type Matrix = Array[Array[Short]] 4 | 5 | def Matrix(width: Int, height: Int)(values: Short*): Matrix = ??? 6 | 7 | extension (m: Matrix) 8 | def apply(x: Int, y: Int): Short = m(x)(y) 9 | def update(x: Int, y: Int, value: Short): Unit = m(x)(y) = value 10 | def col(x: Int): Array[Short] = m(x) 11 | def row(y: Int): Array[Short] = ??? -------------------------------------------------------------------------------- /workspace/w13_photo_proj/images/boy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/w13_photo_proj/images/boy.jpg -------------------------------------------------------------------------------- /workspace/w13_photo_proj/images/car.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/w13_photo_proj/images/car.jpg -------------------------------------------------------------------------------- /workspace/w13_photo_proj/images/duck.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/w13_photo_proj/images/duck.jpg -------------------------------------------------------------------------------- /workspace/w13_photo_proj/images/jay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/w13_photo_proj/images/jay.jpg -------------------------------------------------------------------------------- /workspace/w13_photo_proj/images/moon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/w13_photo_proj/images/moon.jpg -------------------------------------------------------------------------------- /workspace/w13_photo_proj/images/shuttle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunduniversity/introprog/f8b9909c6b30ce57ac5d398da6588ba2208fd46b/workspace/w13_photo_proj/images/shuttle.jpg -------------------------------------------------------------------------------- /workspace/w13_photo_proj/project.scala: -------------------------------------------------------------------------------- 1 | //> using scala 3.5 2 | //> using option -unchecked -deprecation -Wunused:all -Wvalue-discard -Wsafe-init 3 | //> using dep se.lth.cs::introprog::1.4.0 4 | --------------------------------------------------------------------------------