Retina MacBook Pro

After almost 6 weeks after placing my order with the Online Apple Store, my new MacBook Pro with Retina Display (let’s just call it MBPwRD from hereon) was finally delivered to my doorstep earlier this week.

The screen is every bit as gorgeous as promised, though of course there are many applications that have not been updated for the retina display (the official Twitter App and Microsoft Office 2011 included), which makes them seem like a fuzzy mess compared to other retina-compatible applications. The initial user experience has also been pretty awesome, thanks to the speedy flash storage coupled with the latest Intel processors. And have I mentioned how sleek the profile is? (It’s like carrying an oversized MacBook Air)

Definitely a good buy for mobile professionals seeking computing power on the go. Or you know, a first year medical student.

The Resolutionary new iPad

Image Credits: Apple PR
Image Credits: Apple PR

With the conclusion of the latest Apple event announcing the new iPad, traditional media outlets and social media outlets are abuzz with how disappointing the new iPad is. It is not the first time, nor will it be the last, that Apple have failed to wow tech pundits or the everyday consumer with its new product announcement. However, in my own opinion, the latest iPad is anything but a let down.
Continue reading The Resolutionary new iPad

Coordinates, Coordinates, Coordinates

Took me quite a while to write this block of code:

(Note: You will want to compare this chuck of code with the screenshot of yesterday’s source code – otherwise it wouldn’t make sense.)

do
{
   if (abs($id - $center) < = $r['sight']) {
      $ccx = $coordx + ($id - $center);
      $ccy = $coordy;
   }
   else 
   {
	$rowadj = ($id-$center)/$sight;
	$rowadj = round ($rowadj);
	$ccy = $coordy - $rowadj;
	$newid = $id - ($rowadj*$sight);
	$ccx = $coordx + ($newid - $center);
   }
   $cellcoord = $ccx.','.$ccy;
   $content[$id] = $id.'
('.$cellcoord.')'; .....

And the end result? Now we know the coordinates of each individual cell that is displayed on screen. This means that I can soon add in events as the character traverse the “world”.

Not the cleanest code, but it will serve its purpose for now. Awesome stuff. (:

The beginnings

I finally worked out how to display a table with individual cell IDs representing the coordinates for my current project (It’s called Kingdom of Might – cliché, but then again it’s just a project name for now). And now it is just a simple matter of displaying the content in each individual cell using an array like $content[$id]. Took a while to figure out the math and the centre cell positioning, but now I got it worked out.

(There will be a sight attribute to the game, which decides how many grids you can actually see.)

Stage 1: Labeling each individual cell with an ID. Note that the first cell is blank due to it having a value of 0.

Stage 2: Determining the ID of the center cell.

I use this formula: c = [s(1+2s)] + s
where c is the centre cell id and s is the sight attribute from the database

Stage 3: Putting everything together.

And the code that made it work: