Nokia Lumia 800 For Free-ish
/
Very nice too
I only went into the Orange Shop to see what the phone looked like. I wasn’t really far enough into my contract to make it possible to do a upgrade right now. Except that the phone did look very nice. And I can probably find someone who will give me a few quid for my good condition Samsung Omnia 7 (which was until 30 seconds or so into the demonstration my favourite Windows Phone). But the deal clincher was a good one. Turns out that if you are an employee of the university you can get a 25% discount on your Orange phone bill if you take out a new contract. Which means that over a year I’ll save a goodly chunk of the upgrade price. So that was that. Where do I sign?
I’m now the very proud owner of a Nokia Lumina 800. The wheel has turned all the way round. I started out with Nokia phones all those years ago, with a lovely 7110 (the “Matrix” phone) and went through a number of Nokia devices before I jumped ship because the lure of writing programs for my phone just got too great.
And now I’m back with blue boxes. The packaging and presentation were excellent. The phone is a really, really well crafted object. It has quite a turn of speed compared with the Samsung (not that my old phone was ever much of a slouch). The camera is a step up too, and even takes reasonable flash pictures. I’ve got twice as much space for content and the screen is astonishing. It has the clarity of OLED but isn’t quite as “in your face” as the Sansung.
And it runs Cheese Lander.
The bloke in the phone shop had a Windows Phone as well, an HTC Mozard. He said he hadn't bothered adding the Mango update yet. I told him to go straight home and do the upgrade. Like having a new phone I reckon.
Guide Text Entry in Windows Phone
/
The layout may not be perfect, but it is a lot easier than writing your own text input.
Some of our students are making quite a good job of Evil Squash. There are even a few Windows Phone versions out there, which is nice. One of the things that the game must do is ask the player for their name. Anyone who is using XNA for the game has a problem here, as text entry in XNA can be non-trivial. Unless you use the XNA Guide.
The Guide is a way that you can ask the user questions and do lots of other interesting things. I used it to write a silly program that asks the user for their name.
if (text.Length == 0) { if (!Guide.IsVisible) { // display the guide Guide.BeginShowKeyboardInput(PlayerIndex.One, "Name entry", // title for the page "Enter your name", // question for user "Fred", // default text new AsyncCallback(gotText), // callback method this); // object reference } }
This is the code that I wrote. It is part of the Update method. The variable text is going to hold the name that the user enters. If it is empty I must display the guide to read it. The first thing I do is to check that the guide is not already visible. If it is I don’t need to display it again. Remember that Update is called 30 times a second on the phone, I don’t want to be overwhelmed by loads of guides.
The BeginShowGuide puts the guide on the screen. The first three parameters make very good sense, the last two are a bit more confusing. The fourth parameter gives the Guide the method to call when the user has finished typing in their name and pressed OK to close the Guide down. The fifth parameter just needs to be a reference to an object that can identify the request. I’ve given it the value of this, which is a reference to the current game. The result of this method call is that the guide is displayed, as you can see in the screenshot at the top.
When the user closes the guide, either by pressing ok or cancel, the Guide will call the gotText method that I told it about:
void gotText(IAsyncResult result) { if (result.IsCompleted) { text = Guide.EndShowKeyboardInput(result); if (text == null) { // user pressed cancel text = "Cancelled"; } } }
This checks to see if the request is completed. If it is the method gets the text from the Guide by calling EndShowKeyboardInput. If the user pressed cancel the Guide will return a null string. The code above sets the text to Cancelled, otherwise the text is left as whatever the user typed in.
My program just draws the name string on the screen:
You can find a sample project with this code in it here.
Rampant Robots
/
We let the students give their robots names. As well as “Pet Art” above we have two Daves and one Eric.
We had a proper session of robot control today. We were making robots that don’t fall off the desk. We had a few miss-wired connections and people discovered that two motors told to go at full speed don’t actually go at the same speed. So the program can’t just assume that things will happen the way they should….
Next week we are going to see about making the control software multi-threaded so that we can drive the motors and monitor the sensors at the same time. Great fun.
Windows Phone Camp Hull
/Ben addresses the audience.
Ben and Joanna from Microsoft came to see us today and deliver a full afternoon of Windows Phone sessions. We had phones, programs, pizza and tea and coffee. But no biscuits. Sorry about that. Anyhooo, a great time was had by all. Thanks to Ben and Joanna (I keep thinking of ice-cream when I type their names like this) for coming all this way and back in a day.
We did some silly development and we spent some time making a really funky windows phone camera. I promised a download of the code, here it is.
Programming Humans with Evil Squash
/
I’m gaining a new respect for board game designers. It turns out to be quite difficult to create rules for the games that are unambiguous and easy to understand. Even what I thought was a simple game, Evil Squash, has turned out to have some nasty edge conditions that we have had to think quite hard about.
Of course, a game design is really a “program for humans”. It is a sequence of instructions that involve the processing of data, with decisions and outcomes. The tricky part is that the rules are written in English, which is a language in which it is very hard to make yourself completely clear.
Perhaps as an introduction to programming we could get a bunch of people to design the rules for a game of some kind, and then “debug” it by playing the game. I’m certainly going to invent a new “imaginary” game for each first year programming course from now on, just exploring the rules and getting students to think about how they work has given a nice new dimension to the coursework.
You can find out more about the game itself at www.evilsquash.com.
Free Computing Books
/Someone on the forum has posted a really good link to online computing resources. Thanks for that.
You can find the books here. And yes, the C# Yellow Book is in there…
DevXS 2011 in Lincoln
/The University of Lincoln has organised a developer-fest this weekend and there are some Hull students in the mix too. The format is a bit like Three Thing Game, except that the event runs over three days and they are trying to do some useful things. It all looks great fun and you can follow the progress of the event here.
Building a Robot Army
/Spent some time this morning building robots. Actually I didn’t, students on a hardware interfacing course did all the hard work. They are all Fez Micro Framework powered and great fun. They are based on the same platform as Oscar, who has been all over the place with me over the last couple of years.
Next week we are going to get some C# code into them and get them running around the desks and not falling off the edge. Then we are going to get another Micro Framework board running and see if we can control them via the internet.
Great fun.
Lego Addict
/I think I might have a problem. (actually, I think I might have lots of problems, but I’m not particularly keen to blog about any of those).
Anyhoo, I was taking back some Lego to the toy store because we needed some different prizes for Three Thing Game and I succumbed to the rather nice little truck design. I then spent a happy hour watching Naff Telly (so naff I’ve forgotten the program) and building the vehicle. It is now amongst the other Lego toys collecting dust on a shelf. And Lego keep sending me catalogues, and I keep buying things, and making them.
I wonder if there is an organisation for Lego Addicts. If there is, I hope it is much more than a 12 step program for recovery. I’d hope for at least 150 steps and a nice instruction manual to work through. With pictures.
Filthy Hands
/My hands keep changing colour. They go from a healthy pink to a dingy grey. I was ready to put it down to old age (well, perhaps middle age) the first time I saw it. Then I realised what was happening. My new, nicely trendy, black jeans were dropping some of their colour onto my hands each time put my hands in my pockets.
The other snag with trendy black jeans is that you wash them once and they turn instantly into streaky grey ones. But hopefully they’ll keep my hands cleaner.
Visiting the Iron Duke
/View from the pointy end, which I’m reliably informed is called the “bow”.
We went to see HMS Iron Duke today. This is a warship that has “adopted” the city of Hull and drops by whenever it is passing, although perhaps it is a bit more complicated than that. Anyhoo, we went off to take a look round and grab some pictures. Thanks to the crew for letting a bunch of folks traipse around your decks.
I love this sign. I just worry that I don’t know what the alarm sounds like…
The Lord Mayor came to see the ship too. That’s his Jag.
Uncharted 3–Drake’s Deception
/Bought the third in the Uncharted series of video games today. I must admit I’ve not actually quite finished the second one yet. I got stuck taking on some really nasty crossbow wielding goblin thingies that were very hard to kill. But I was very close to the end.
The third instalment of “Tomb Raider with a bloke” is very much in the same vein as the previous two, but very, very well done. One of the best bits for me is that in this one you usually have a partner with you and they are actually quite useful to have around. Unlike some games, where your comrades stand around getting shot while you solve the puzzle and take out the bad guys, these folks are quite engaged and will even give you problem solving tips if you stagger around dumbly for long enough.
The locations that I’ve been to so far have all been excellent. I feel kind of guilty not taking in the beautifully rendered environments while I’m going for a headshot on the rocket launching zombie on the other side of the valley, but it all looks very nice.
The scenario with its strange maps from the past, underground tombs and “Say, do you think that statue might rotate?” moments is very like the earlier ones, but in a good way.
The stern message at the start says that you should take a break of at least 15 minutes in each hour of gameplay. But this is not a game you can really play in 45 minute chunks. Me, I keep getting dry eyes because I forget to blink during the gameplay.
If you liked the earlier ones you’ll love this. If you’ve always wanted to take part in an Indiana Jones movie, you’ll love it too.
The Best Way to Write Programs
/So, how would you represent the arrows?
The Software Development for the First Year C# Programming course this year is a game I have invented. I’ve called it Evil Squash. It even has its own web site:
The game is very like Snakes and Ladders, but with a twist that makes it a bit like Ludo as well. At the moment we are working on the player movement, which uses a board like the one above. When a player lands on the tail of an arrow they must then follow it to the destination. We have decided that there are three ways that you can implement this behaviour.
- A whole bunch of conditions that hard wires the arrows into the program
- An array with a location for each square that provides a redirection to the destination square.
- An array of “redirects” that holds the behaviour of the 10 arrows
You might want to consider which is the “best” one. To me, the answer is “you can’t say”. Each of them has advantages and disadvantages. Some of them use less memory, some go quicker. Some are easier to test and some are easier to understand.
One of the things that we try very hard to do in the programming course is to get people to think that often there is no “best” way to solve a problem, merely ones that are better than others against certain criteria. We give extra marks to students who manage to use arrays (I’ve nothing against hard wiring the arrows, but I thing showing you can use an array is something that should be rewarded).
Next week we are going to get the player and the “Evil Squash” behaviour sorted, on the way to making a complete game and maybe even some AI powered opponents.
I’m keeping the domain in case we get some good ones (maybe even phone based) that we might want to distribute.
One student has suggested using a Dictionary. Good idea.
Don’t Take Your iPad to Meetings
/I took my iPad to a meeting today. I do love the device to bits (although the battery life seems to have taken a bit of a hit since I upgraded it to the latest operating system) as it is a great way to consume content. Unfortunately I was reminded again of how hard it is to make good use of it to take notes. While some of those around me were confidently tapping text into their netbooks and laptops I was trying to persuade the shift key to do what I wanted and writing “auto-corrected” rubbish. If I had remembered to bring the Bluetooth keyboard to type text in things might have been easier, but as it was I ended up with a few lines of garbled text. Oh well.
Windows Phone Event at Hull University
/Microsoft are coming to Hull on Wednesday the 16th of November for some intensive Windows Phone Development action. The event will run from 1:15-5:00pm in Lecture Theatre D in the Robert Blackburn Building. It includes an afternoon tea break, and takeaway pizza at the end.
If you want to find out how you can take your C# skills and apply them the phone, sell you applications and maybe even make some money, then you you should come along.
Spaces are limited so register on EventBrite for free here: http://hullwindowsphonecamp.eventbrite.com/













