Skip to main content

An app and a story

An app and a story

I am not writing anything about coding tip here. But telling you how my app Shataka came into existence. 

Few years back, I had started an app, whose idea was to find all combinations of numbers to get the required sum. Something like, 

90 = 10*9
     = 45*2
     = 200 -110
etc.

Then the app was killed because my computer was. I did not have a single line of code remaining. 

That was metamorphasized into this unique app Shataka. As far as I know, in android market there are not many number games for adults. There are few me-too versions of 2048 and few apps which ask you to type what is 10 +2 etc.

But in this app, the sum was to be 100, for rows and columns. And typing the numbers is clumsy and guessing 9 numbers to fill in 3 by 3 grid for this is too time consuming. So what if I provide the numbers after shuffling them?

Yes. I provide 9 numbers which if arranged in an order, make a grid with sum of each row as 100 and sum of each column as 100.

e.g.

81 4 15
10 73 17
9 23 68

So I generate one set of numbers - which will be one puzzle. I generate a second set, third set. How many sets should I store in the app? It should be possible to generate numbers randomly. 

Generate one number randomly. Then find combinations for next 2 numbers etc. e.g. if let us say number is x1 is 10, then x2 can be 60 and x3 can be 30. Now 10+x4+x7 = 100 and 60+x5+x8 should be 100 and 30+x6+x9 should be 100. And also x4+x5+x6=100 and so on.

Few random numbers, few equations and some iterations, our puzzle set is ready. Give an empty grid, below which give 9 numbers and ask the user to fill the grid.

What I realized is, for the beginner, it is difficult to select numbers. Then I thought of hints. Providing hints for games is too complex. At least for this game it was. 

If not hint, how about giving them partial solution. For the easy level, fill 3 cells of the grid, so that user needs to add only 6 numbers. That will be better and that will also make the game familiar. 


That is what you see in Level 1 of the game. Level 2, gives the user 2 solved cells, level 3 gives 1 solved cell. And of course there are no solved cells in level 4.

Is that all? Will this game have only 4 levels? That will be too ridiculous. What if we add an extra number, which is not part of the solution to the game like this

 We have 10 numbers given instead of 9. So makes the game little bit more challenging. 

So that provided us level 5 and 6(with 2 extra numbers) and 7(3 extra numbers). 

And with these features, I published the app

But the game will become boring if it has only 7 levels. So in next version, I thought of not just shataka, but sahasraka - shataka in Sanskrit is 100 and sahasraka is 1000. So provide three numbers to add up to 1000.

And what about a sum of 77 or 92 of 66 that is some random 2 digit number. That is another set of levels 


   

Why is there no screen shot of sahasraka - because I have not yet reached that level :) 

So dear readers, what is the next feature you want me to add to this awesome game? 

Comments

Popular posts from this blog

Copy to clipboard

In my upcoming app, I have codes which I display. These are some times lengthy, and I want the app to be able to copy this to clipboard. Once it is in clipboard, users can paste it anywhere. So how do you copy some text from your app to clipboard. You need to use clipboard manager. Clipboard Manager This class sets and gets data for the clipboard using Clipdata objects.  You can get the object of this class using system service.  - using statement context.getSystemService(Context.CLIPBOARD_SERVICE) Example I have a dummy project with a button, onclick of which copies content to clipboard. Here is my activity file package com . hegdeapps . testapp ; import android.content.ClipData ; import android.content.ClipboardManager ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; import android.view.View ; import android.widget.Button ; import android.widget.TextView ; public class MainActivity extends ...

Drawables in Android - Layer drawable

Let us see how to use layer drawable. You can have two or more bitmaps on different layers to create such a drawable Using xml : You should use layer-list in your xml file to create layerdrawable. Here is layer.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <bitmap android:src="@drawable/whiteicon" android:gravity="top|left"/> </item> <item> <bitmap android:src="@drawable/blueicon" android:gravity="top|left"/> </item> <item> <bitmap android:src="@drawable/redicon" android:gravity="top|left"/> </item> </layer-list> We are using three different bitmaps whiteicon.png, redicon.png and blueicon.png which are present in /res/drawable/mdpi folder. All these are of different sizes and aligned to top left. Thi...

Using a list fragment with cursor adapter

All these days, I avoided using fragments. But then I realized for my this particular applications fragments are ideal. I have a master - detail list in my app. Let us say you want to have two fragments - one is a fragment which contains a list of elements and second one expands one element of the list. Both of them share the same cursor from the activity. Let us start with list fragment. Do not try creating list fragment using a wizard. It unnecearrily adds too many methods and classes. Let us start writing our own fragment like this class MyListFragment extends ListFragment { } Next using code menu override option, override the following method onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) This method should be used for inflating the layout file for the fragment.  I have a framelayout in parent activity of this fragment with the id as container. So I will specify that for inflating. The framelayout will be the paren...