Making a simple Game using Enums

This idea stemmed from the fact that majority of developers create an UI in Interface Builder without an issue, but the real struggle comes when they have to write the code and it was difficult for me to believe at first that writing code or structure is really difficult, so I decided to write these […]

Advanced Usage of Functional Methods

In the last post at reducing-code-for-readability-and-speed which took you through using functional methods instead of loops. The issue was that in some of these functions you might require the index and therefore pushed one back to using loops instead.

Reducing code for readability and speed

In a conversation a couple of days ago, somebody mentioned that they needed to determine the missing digit(checksum) of an ISBN-10 number. This was interesting, specially because this was a perfect example for reducing the lines of code written to resolve this. The specification of ISBN-10 checksum The final character of a ten-digit International Standard […]

Build your own command extension for OpenTerm

Open Source projects are fun because there are a lot of amazing developers that spend time and effort and create something that all can use. What is more fun is the fact that other amazing talented developers add functionality and features to these open source projects. There is one such project called OpenTerm (was called […]

Add Numbers to get a value so Attitude = 100

You must have come across this little fun stuff that does the rounds on Social Media that adds the alphabets in a word to get a value. This is generally used for Motivational purposes or to prove points. For example, ATTITUDE = 100, BULLSHIT = 103, you get the idea. Let us use Swift to […]

Creating a command-line application

Swift is useful in creating not only Mobile applications or Mac OSX GUI applications it can be used to also create a commandline application which is run on the Terminal. Let’s start with the simplest/minimalist application. There is an commandline utility called yes. If you write and use bash scripts, then you could have come […]

Rotate an Array in place

The interesting things that you would face during Interviews are mostly in the form of puzzles and challenges. These are meant to not tickle your brain but instead it can stump you. On top of that, if you really give it a thought, some of these questions or scenarios are based off bad architecture and […]

Rules Based Fizz Buzz

If you have interviewed at any point recently, then you might have come across the FizzBuzz problem. No, it is not to do with long term storage of your open cola bottle. It is based on a childhood game (I knew of a variant, not FizzBuzz) the idea is simple, you stand in a circle […]

Solving Spotify puzzles using Swift

You must have at some stage attempted to learn about algorithms and searched for puzzles to write algorithms for to solve. There are three interesting puzzles laid out by Spotify at https://labs.spotify.com/puzzles/. We shall have a look at solving those using Swift