Questions tagged [scala]

Scala is a general purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles.

Filter by
Sorted by
Tagged with
2
votes
1answer
362 views

Formatting as a table in Scala

I'm trying to get my head in the Scala game, and would welcome feedback on the following code, which produces a table from data. ...
6
votes
1answer
671 views

Conway life game implementation with scala

I've tried to create optimal in terms of performance and memmory consumption. But also I've tried to make it functional and scala way. I want to get you comment on how to make it more 'scala'stic <...
0
votes
1answer
638 views

Composite Design Pattern in Scala

The following is a personal attempt at implementing the Composite design pattern in Scala. Observation is abstract... ...
6
votes
3answers
3k views

FSA (finite state automaton) in Scala

I'm a beginning Scala programmer with a strong background in functional programming (ML, Haskell, Scheme) and I've just written my first Scala program. It is an implementation of a FSA (finite state ...
5
votes
1answer
559 views

Processing XML configuration which stores regular expressions and format strings for a documentation tool

I'm investigating some feature for the ScalaDoc tool, which would allow library writers to link to documentation created by third party tools like JavaDoc. My idea is to have some (XML) configuration ...
2
votes
4answers
5k views

Calculating a base price with surcharge conditions

The following code has a lot of conditionals. I am trying to write it in a functional programming way. ...
3
votes
1answer
420 views

Initialize a Sieve of Eratosthenes in Scala

I am learning Scala while solving some exercises and I am currently solving an exercise where I need to initialize a Sieve of Eratosthenes. I am using the following code: ...
5
votes
2answers
227 views

Checking a collection of Ints

I'm learning a little Scala by writing a little card game. What I want to do here is check that the Traversable[Team] supplied has the same number of team members ...
5
votes
2answers
811 views

Producing full list of Fibonacci numbers which fit in an Int

I am progressing through the problems listed at projecteuler.com as I learn Scala (my blog where I am covering this experience). I have written a function to produce all the Fibonacci numbers possible ...
2
votes
2answers
205 views

Scala list folding

I'm trying to learn scala. It's hard. I currently have a tree in the form class Node(children:List[Node], value:Int){ } I want to calculate a total cost ...
5
votes
3answers
424 views

Decided to learn Scala. Here's an attempt at a Cloth simulation

I have never done anything functional before. These two functions are hideous to look at. II think the first step to do is extract the inner bits out and then map over my arrays. What else can I do to ...
2
votes
2answers
563 views

Scala mastermind solver, which is the most scala-ish

I am trying to express the classical TDD kata of mastermind in the most idiomatic scala I can. Here is a scalatest, test suite : ...
3
votes
3answers
504 views

Alien Numbers - how Scala-ish is my solution?

I'm trying to solve an old GCJ. It's a very simple puzzle, but I'm trying to sharpen my Scala-fu. Basically, you're getting a list of triple ...