Questions tagged [kotlin]

Kotlin is a statically typed programming language that compiles to JVM bytecode, JavaScript, or native binaries.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Iterate through a 2D array. Kotlin extension method

Simple extension method for Kotlin. Should perform an action on every element in a 2d array. i.e. An array of arrays. I have made the assumption that because the receiver type is defined as an array ...
JNB's user avatar
  • 191
3 votes
1 answer

Interface to the REST API

I'm implementing an interface to the REST API, with very specific ideas about which parts of the API I need. My problem is with testability of consumers of this API abstraction. The first ...
mabi's user avatar
  • 141
6 votes
1 answer

Number guessing game in Kotlin

Is this code missing any "Kotlinisms"? I've just started learning Kotlin so I'm not yet familiar with the Kotlin way of doing things. The program will guess a number you are thinking of. ...
JNB's user avatar
  • 191
3 votes
2 answers

Cache of shared observables (Rx)

So the idea is to maintain a cache of shared Observables - accessible by a key - which if not present will produce one using the given factory. The underlying shared Observable is accessed via an ...
Ross Anderson's user avatar
10 votes
3 answers

Max heap implementation in Kotlin

I wrote this class a while ago to learn Kotlin and heaps, so any tips (on either my code style or my heap algorithm) would be appreciated! ...
Andrew Sun's user avatar
5 votes
1 answer

Stateless 2048 Game

I created a little Kotlin clone of the 2048 game that is playable in the console. My goals were readability and statelessness for no other reason than practice. Consider it a code kata wherein I didn'...
IAE's user avatar
  • 765
4 votes
1 answer

Simple thread-safe loading cache based on RxJava

I'm sketching a simple thread-safe cache which can load missing values. It is based on RxJava's Observable which also means that it should be possible for a client to join a request for value which is ...
Alex Dmitriev's user avatar
2 votes
0 answers

Converting SpriteSheet Metadata .txt to .yaml

For practice I decided that I wanted to write an animation class for SpriteSheets. The problem is that a single Sprite can have different widths depending on the action they are drawn to act. A tool ...
IAE's user avatar
  • 765

1 2 3 4 5