Questions tagged [kotlin]
Kotlin is a statically typed programming language that compiles to JVM bytecode, JavaScript, or native binaries.
258
questions
1
vote
1
answer
3k
views
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 ...
3
votes
1
answer
74
views
Interface to the Force.com REST API
I'm implementing an interface to the Force.com 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 ...
6
votes
1
answer
667
views
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.
...
3
votes
2
answers
963
views
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 ...
10
votes
3
answers
3k
views
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!
...
5
votes
1
answer
454
views
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'...
4
votes
1
answer
1k
views
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 ...
2
votes
0
answers
320
views
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 ...