I just finished Jewel Quest yesterday after getting hooked to it after understanding how everything works. It is a good game that’s similar in standard game play like Bejeweled but having a different twist. To start off, you are presented with a board of jewels and to score and finish your goal, you would have to match 3 or more jewels horizontally and/or vertically much like how you play it in Bejeweled. Now, here’s the twist. Once you match jewels, the square area that they are placed in, turns to gold. The object of the game is to turn all squares in the board into gold and you’re off to the next round. Easy? At first, yes. But as the game goes on, new levels introduce you to new twists like coins (image on the right), which I never understood what it really does until I was almost a few levels to the end of the game. Another twist in the game is having rocks instead of jewels that show a little color at first (small image on the left). What this means is that you actually need to pair this one with the same colored jewel in order to match it. I never understood how those rocks worked until when I was almost done with the game. I’m not sure if there is a game over i this game because with the number of times that I did not clear the board, I was sure that I ran out of lives haha. You will also encounter monkey faces which means that if you match them together, if the square area is already gold, it turns back to its original color and you would have to make it gold again, delaying your goal. Both coins and monkeys disappear when they reach the bottom of the board. If you do match up coins together, you get a coin bonus which you can use to color a square area gold if you see time is running out and you cannot do any matches anywhere near the square area. The game is easy to play if only the board is proportion horizontally and vertically. Problem is, the board changes shape on each level, and your goal gets harder (photo on the right is not from the iTouch version, but you get the idea).

I came across someone else’s code a long time ago and I thought someone else may find this useful since this class has been part of my library whenever my program involves cookies. It is a class by Saar Machtinger.

Say for example you wish to log in to a site and want to keep your session intact when you access the site’s other pages (since they require you to be logged in). To use this class, do the following

We need a URL connection to set which site we want to log in to. Then specify the username and password and use the OutputStreamWriter’s write() method to emulate an HTML Form post action. The last method call, viewAllCookies() displays all data that are stored in the cookie. Please remember that the parameters passed like username and password are not the same in all sites. You should check the site’s HTML FORM tags and see what other hidden fields are included that could possible be needed in order for you to be able to logged in properly.

If you wish to access other links of the site that require you to be logged in, just use the CookieTool object ct like this

You can then use the HttpURLConnection’s getInputStream() method to get the InputStream and use it to retrieve the contents of the HTML page. Getting the contents of the InputStream and storing it in a String object is another story. There is a nifty code that I use to do this (I forgot who coded this). Just go here.

Creating a hyperlink element using Javascript is pretty simple. Do the following. Notice, that the hyperlink element contains two text ‘click me’ that’s been set twice. This is because IE only accepts its proprietary innerText property to set a hyperlink’s text while other browsers use textContent. To set a CSS class name, you need to use the className attribute because the class property is a reserved word in Javascript. You can either use it as element.classname = 'class_name' or element.setAttribute('className', 'class_name');

Related Posts Plugin for WordPress, Blogger...