Skip to main content

Shata problems of Shataka

After luke warm response I received for my game "MemoryPro" I wanted to develop another app. Due to limited resources and lack of much graphical skills, the game should not involve not of graphics and animation.

Then the idea came, why not add the numbers to 100 in a grid? So was born GetHundred the game where each row should add to 100 and each column to 100.

What about the data generation? That is which numbers am I providing the user? First set was calculated by me on paper. Then I generated few more sets. And thought I can hard code the solution numbers and store them in the app.

Some how that did not seem right. How many sets do I store in the game? What will the game do after all the sets are cleared by user? Won't it be better if the numbers can be generated dynamically? So that each time, the numbers would be different.

Hence I started scribbling equations. Some thing like a11+a12+a13 = 100, a11+a21+a31=100 etc.

To cut the story short, I did find the way to generated numbers - few random, rest calculated.

Next came the drag and drop of these numbers to grid. Stack overflow told me that android has direct methods to achieve drag and drop. Great. I took the code and implemented it.

But what happens if the user drops the number outside the grid? What happens if he drops it back to same place instead of grid?

OK, so I wrote if the dropping view is not part of grid or data table, cancel drag and drop operation.

Little did I realize that this drag and drop methods are not supported in android froyo - my first smart phone. All these days I was testing my apps in 2.2 android and 4.0 both. But now I had to either write all these magical action myself or leave 2.2 phone support to app. I went for the easier option. I gave minimum sdk version as 11 instead of my usual 8.

With functionality almost ready, I wanted to see other puzzle games. Unblock me - was very addictive. Instead of getting inspired by this app, I started playing it. Joking. But believe me, it is a great stress buster.

So this app gave me idea of undo the move and restart the game. Undo - ctrl z has become so ingrained in us, but we rarely give us a thought about how it is implemented. Do I give one undo or multiple? If multiple how many? My data structure knowledge helped me here. Stack is ideal structure for "undo" feature. And thank God, Java has Stack class. So I would store the moves in stack and when undo is pressed, remove it from stack and undo it. e.g. if the latest move was to dropping the number from data cell d4 to grid cell a13, then after removing this from stack, the number in a13 would be moved back to d4.

That implemented followed by restart action implementation, only thing left was to make the app look good. How do I color the cells. Single color or a png file or gradient drawable. I tried all possibilities. I would find all these good.

A very strong and muscular man was to be kept busy. His boss gave him a room full of wood to be chopped. In an hour the big man came asking for next work. His boss gave him a large pile of potatoes and told him to separate them into good ones and bad ones. In evening when boss came to see the big man, he holding a potato in hand deep in thought. To put it in good pile or bad pile.

So that is how it was. I took almost a month to put the correct ui.

When I finally published it in google play, it told me the app is of medium maturity. Why? I was worried, upset, angry and all range of emotions. I wrote to them. Still expecting an answer.

Note : Shata is 100. Normaly in cricket a person scores a shataka - a century. I call others and am called myself  "shata mallu" (mallu is mad)

Comments

Popular posts from this blog

Someshwara shataka

ಚರಿಪಾರಣ್ಯದ ಪಕ್ಷಿಗೊಂದು ತರು ಗೊಡ್ಢಾಗಲ್ ಫಲಂ ಈವಿದಾ ಮರಗಳ್ ಪುಟ್ಟವೆ ಪುಷ್ಪವೊಂದು ಬಳಲಲ್  ಭ್ರಂಗಕ್ಕೆ ಪೂವಿಲ್ಲವೆ ನಿರತಂ ಸತ್ಕವಿಗೋರ್ವ ಗರ್ವಿದಂ ನೃಪ ತಾಂ ಲೋಭಿಯಾಗಲ್ ನಿಜಂ ಧರೆಯೊಳ್ ದಾತರು ಪುಟ್ಟರೆ ಹರ ಹರಾ ಶ್ರೀ ಚೆನ್ನ ಸೋಮೇಶ್ವರ Will a bird in the wild go hungry just because one fruit tree dries up? If one flower withers, will not the bee get any flowers? If one haughty king is miserly, will there be no patrons (of poetry) on this earth? ಕೆಲವಂ ಬಲ್ಲವರಿಂದ ಕಲ್ತು ಕೆಲವಂ ಶಾಸ್ತ್ರಂಗಳೋದುತಂ ಕೆಲವಂ ಮಾಳ್ಪವರಿಂದ ಕಂಡು ಕೆಲವಂ ಸುಜ್ಙಾನದಿಂ  ನೋಡುತಂ ಕೆಲವಂ ಸಜ್ಜನಸಂಗದಿಂದಲರಿಯಲ್ ಸರ್ವಜ್ಞನಪ್ಪಂ ನರಂ ಪಲವಂ ಪಳ್ಳ ಸಮುದ್ರವೈ ಹಾರ ಹರಾ ಶ್ರೀ ಚೆನ್ನ ಸೋಮೇಶ್ವರ Learning from wise men, reading from good books, observing others  work and learning from good company, these are the ways a man becomes omni-scient (sarvajna - one who knows everything). Just like many streams join together to make an ocean. P.S. 1) If you find some of my wordings in this shataka is wrong, please let me know. It is a 40 year old memory. 2) There are also many tripadis(poem

AA

This must really go to facebook page. But since I am currently not in facebook, I am putting it here. If you feel any of your close ones or your friends and relatives are addicts or on the way of being addicts, introduce them to Alcoholic anonymous. They have meetings all over the Bangalore and in other towns in India also.  I have taken this list from AA India site . The site also contains lot of information about alcoholics including a questionnaire to find out if a a person is an alcoholic or not.   BELGAUM ADDRESSES TIMINGS New Life Group.    St, Anthony Kannada High School,    Opp. Fish Market Khanapur Road, Camp Belgaum-590006 Anand – 099026 87947 Sat 6.00 p.m. Back Top BENGALURU ADDRESSES TIMINGS

ಒಗಟು

ಇದು ಕನ್ನಡದ ಒಂದು ಒಗಟು. ಅಮ್ಮ ಹೇಳಿಕೊಟ್ಟಿದ್ದು. ನೋಡಿ ಬಿಡಿಸಲು ಆಗುವುದೋ ಎಂದು. ಉತ್ತರೆಯ ತಾಯ ತಮ್ಮನ ಕತ್ತಲೆಯಲಿ ಒತ್ತಿ ಕೊಂದವನ ಅಗ್ರಜನ ಪಿತನ ವಾಹನದನ್ತಿರ್ಪವನೆ !!! Hint : you must know your Mahabharatha well. One more. ಹರನ ಹಾರನ ಆಹಾರನ ಸುತನ ದೇವನ ಮಡದಿಯಂ ಕದ್ದೊಯ್ದವನ ಅನುಜನ ಮಡದಿಯೆನಗೊಲಿದಿರ್ಪಳ್ P.S. : If you find the solution, you can mention it in the comment :) Since no one came up with solutions, let me mention them. Uttara's mother's younger brother is Keechaka. The one who killed him in darkness is Bheema. His agraja - elder brother - is Dharmaraya. whose pita - father is Yama. Yama's vahana is buffalo. So the ogatu, is to call some one a buffalo. Second one is Hara's garland - haara is snake, Snake's food is Vaayu - air. Vaayu's son is Hanuman. His god is Rama. The person who kidnapped Rama's madadi - wife - is Ravana. Ravana's anuja is Kumbhakarna. His wife is Nidra - sleep. So all this just to say I am sleepy.