Skip to main content

Posts

Showing posts with the label #kotlin

source code of simple memory game - Simon

Simon game is an electric memory game.  The device creates a series of tones and lights and requires a user to repeat the sequence. If the user succeeds, the series becomes progressively longer and more complex. Once the user fails or the time limit runs out, the game is over. Read in wikipedia. This android game is a simulation of that.  The buttons on the screen glow in some order with their notes. The user must reproduce these button clicks in the same order.  It is a very good game for memory with the added benefit of audio feature.  The source code of the game is available in my github page  Simon  The android game with Simon and 3 more memory games by Hegdeapps can be downloaded from google play  Basically in our layout file, we have four SimonCell custom widgets which are extended classes of image views. These are the four colored buttons you see in the image above.              ...

Scramble app with Kannada words

 A simple scramble game - that was my original intention. But I needed that words to be in Kannada.      Get a word list - can be inside the code Scramble the list to get random words Select a random word Separate the letters of the word Now scramble the letters of the word Display the scrambled letters  Let the user click on each letter in order to unscramble it Simple. Quite simple. Only difficulty in this case - our dear mother tongue which uses two unicode characters to display a compound letter like kaa, and uses more to display a ottakshara like kka kku etc.  So if the letter is any of the vowel sounds or half letter, we need to add this the the existing a character in step 4. So basically the the list size will be lesser than the string length. e.g. ಶಾಲೆಯಲ್ಲಿ  must give us only four letters -  ಶಾ,   ಲೆ,  ಯ  and   ಲ್ಲಿ    So here is the code in Kotlin There are two kotlin files - one is viewmodel and the other i...