Code Monkey home page Code Monkey logo

introprog-scalalib's People

Contributors

axelnilsson98 avatar bjornregnell avatar fritjof-b avatar husenap avatar jos-rosenqvist-3812 avatar patrikgyllvin avatar sadphi avatar theolundqvist avatar trilleplay avatar wudse20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

introprog-scalalib's Issues

Lack of easy way to append to text files.

After reading though lunduniversity/introprog#782 I think that some of the issues associated with Bank's saving and loading could be addressed by introducing a method that lets the user easily append to text files (since it might feel natural to do so in doEvent.)

I propose that a method be added for appending lines.

Lack of documentation / information for how BlockWindow works?

During the SnakeLab there's some confusion regarding how drawBlock() in BlockWindow works.

This is partly due to the fact that if you instantiate a BlockWindow class in REPL (which students repeatedly are told to play around in) and then use the drawBlock() function, nothing happens.

A solution would be to perhaps have a very primitive code that shows the functionality in a working state, where students can play around as REPL doesn't provide that functionality and still not give away too much, so there's still learning potential.

For example the code found here could possibly help; https://github.com/dixine55/BlockWindow-functionality

Another solution would be to inside of the introprog Documentation mention that drawBlock only works inside of a gameLoop, and specify what that is and how to initiate one.

Composition over inheritance in Snake Lab

It might be better if we instead used composition for the BlockWindow instance in order to just provide the API and not the rest of the BlockWindow code during the SnakeLab.

This would also follow the "Composition over inheritance"-mentality and make it a bit more straightforward for the people working with the code.

Add detection of look and feel for WSL

Running the library on WSL currently throws an exception due to wrong look and feel being used (javax.swing.UnsupportedLookAndFeelException). GTK+ is incorrectly chosen, when it should be the same as for Windows. A check should be added to determine this for WSL.

See also PR #27

update build.sbt, fix cross-pub 2.13, add semVer and make build more idomatic

Event handling not cross-platform compatible and TAB not recognized

Key event handling is not cross-platform compatible as noted in lunduniversity/introprog#491. See also #1 which is related.

I have a working fix for above issues tested on macOS and Linux, see comment lunduniversity/introprog#491 (comment). Could use help with testing on Windows.

Another issue persists which is that TAB key strokes are not recognized by introprog. From what I can gather this seems related to the Focus Subsystem of Swing, where TAB and Shift-TAB will cycle the focus forward or backwards. This would need to be disabled for the event handler to recognize the key strokes.

7.1.36 repl contains typos

The example where the repl is shown in chapter 7 part 1 subpart 36 needs some fixing
As it is now this is how it looks:

scala> type Pt = (Int, Int)
scala> def distToOrigo(pt: Pt): Int = math.hypot(pt._1, pt._2)
scala> type Pts = Vector[Pt]
scala> def firstPt(pts: Pts): Pt = pts.head
scala> val xs: Pde3,3))
scala> firstPt(xde
res0: Pt = (1,1)de

Last three lines needs some fixing

Refactor current detection of OS including WSL

This PR #27 includes a hopefully feasible way to detect OS and set the right look and feel so that window stuff does not crash on WSL + GWSL, and we should test that in as many setups as possible including Windows 11.

However, the code could be refactored to be more elegant and easier to read and also more effective:

We should use java's File stuff instead -- it's unnecessarily heavy to fire up a whole new OS process just to check what's in a file. I did not question the tip on how to detect WSL. So before we make an ordinary release to Maven central 1.3.1 we should fix this. And the isInProc is an implementation detail that should not be visible outside, and actually a part of isOS so that method should use a private isInProc. If so, the code would feel more "natural".

implement JFrame.setTitle in PixelWindow

I am requesting the setTitle method to be implemented and accessible from introprog.PixelWindow. I noticed that JFrame has a method for renaming the frame title, and I am missing this feature in PixelWindow, it could be useful

add Save dialog

in current file dialog there is no file selected, and button says Ok

add tests

add some test to check non-gui-stuff, to be executed with sbt testOnly or scala-cli test or something similar

Documentattion for gameloop is missing

There is no documentation for the method gameLoop(stopWhen: => Boolean): Unit on the api site. This makes the code hard to read for students when they work because the code calls on a method that they don't know what it does.

add junit tests

and when some tests have been added, use sbt test in github actions CI. depends on #19

Ambigous meaning for parameter `fileName` in `introprog.IO`

The documentation in the file introprog.IO for the parameter fileName is a bit ambiguous. After trying to use this library myself and after reading in the course forum in the channel frågor-och-svar, I’ve come to the conclusion that it probably should be renamed to path or add documentation to explain that it’s the path of the file and not just the file name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.