davidn: (savior)
The project was handed in at 2:45pm yesterday. It's rather difficult to believe that it's over.

I woke up at about 8am that morning, and had a nagging thought that I needed to change something before I declared it finished. Suddenly I realised that a part of my search method was probably causing the program to fail to solve a few games, and hurriedly changed that section of the code so the user had the option of whether to discard future states or not. Then I realised that I hadn't written a significant amount of JavaDoc (the section of code that makes the rest of it vaguely understandable) and blitzed through that as well.

When I arrived in St Andrews, there was a minor miracle in that my supervisor had actually opened up the file that I had sent him. Admittedly his feedback amounted to "Go and print it", but it was very relieving nonetheless. And off to Reprographics I went. My fascination with this department was documented last year, and the mood was pretty much the same. They have now moved to a convenient dark basement somewhere in a building in the middle of the town, though, and I had to park miles away at the harbour and walk through the pouring rain worrying about the state of my black and white pages.

"Hello," soothed the Reprographics man as I came in, gliding smoothly over to the desk and instantly melting all my stress away. "What can I do for you?" (I hadn't considered that he had a name before, but I found out on this visit that he's called Duncan. I'd always just thought of him as Diazepam in human form.) I explained the need to print two copies of a project report and he took me into the computer room. I walked behind him, surreptitiously looking down to see if his feet actually touched the ground.

I needed somewhere to put the report in order after printing the colour pages, and decided to make it a bit special and visit the Library for the first time in my life. It was a unique occasion, after all. I didn't actually see much of the building, staying in the first floor reading area and putting pages into various piles. It was actually more reminiscent of a game of cards than I would have cared to admit. And after that, I walked back and dropped it off for binding with Captain Valium, then went back to the lab to radiate some smug for a while before picking it up again.

Finally it was brought back to the lab, signed, shown round proudly for a while, and handed into the office. Then I drove home, blasting the triumphant chords of Weballergy from the car speakers while stuck hopelessly behind a tractor for ten miles.

Now that I have my receipts in front of me, I notice that they say I purchased "Misc Stationary" [sic]. I find this fairly appalling from a department that dispenses stationery as its primary purpose, especially as they're anything but stationary. It was so much more convenient when they were in the Purdie building, next door to computer science.

Do you want to see it? I put it up here. And today I think I'll go in again and watch the Junior Honours people demonstrate their stock market software. And calmly wade through the final rush to get the report in by 4pm.
davidn: (skull)
I've just remembered what my dream was about last night. I dreamt that my recent illness was being caused by a buffer underrun error. The project has rendered me irredeemably insane.

Tomorrow I'll go into the lab again, meet with Ian, who won't have read the report, then give up and PDF it anyway. Then notice mistakes, and PDF it again. Then print it off anyway. Then go to Reprographics and get it bound. Then hand it in. And finally, it will all be over. 3,240 lines of source and 30,020 words of documentation. Ironically it still isn't the longest thing I've ever written. But it seems the longest.
davidn: (bald)
Why can no-one get the idea of Treasure Tower right? I've had a few room submissions back after I asked if anyone wanted to make some additional levels, and the rooms could best be described as "insane". [livejournal.com profile] kingradix, I'm counting on you. Actually, what I'll do is shove all the mad ones into an "Extra" tower, and that should solve everything.

A minor miracle happened today - Ian Gent said that my project was "quite good". Additionally, he was also surprised that I had got this far so quickly, and thought that no one else would be in a position to start writing their project report three weeks before the submission deadline. So I've celebrated by writing a pointless feature - a mode that displays rather crude-looking cards instead of the usual suit-and-value plain output. Have a look.

Before )
After )

True, it hurts the eyes a bit, but it's something else to show at the demo. And yes, it can solve that game!
davidn: (skull)
The trouble with my project is that there seems to be a large imbalance between what I think of my program and how enthusiastic my supervisor is about it. The problem began when I wrote Freecell in a weekend, and his reaction was "Well, it's some code". Since then it's gradually got to the situation where he doesn't think it's much good as it can't solve games consistently enough, whereas I feel that getting a computer to be able to play through any card game itself is a pretty spectacular achievement.

I was surprised by an unexpected Interim Demo today. When I went to the weekly meeting with my supervisor, who was wearing a ghastly shirt decorated with misshapen cows, it happened that my second marker had some free time as well, as he was busy arguing with him about something to do with C++. We went through to his office, which is the darkest room in the world (he keeps all the lights off because he doesn't like them turning themselves off when he hasn't moved for a while), and to my surprise I was able to get it running on a Mac in only a few minutes while the two of them talked about ornithology or something.

Tom was far more impressed with the project than last time around, when it took ten minutes just to get the thing running, and watched as it went through a couple of games. At one point he asked me why there were two Tens of Diamonds on the screen just to scare me. My supervisor responded to this by going over to the whiteboard and beginning to throw a pile of about a hundred pens at him, so the rest of the demonstration had to be carried out under a hail of felt-tips.

With that demo done, I'm pretty much on the home stretch now. And it's just as well, because practicals for this year are beginning to come in. Actually, the lecturers are on action short of a strike, meaning they can't do anything to do with grading work or giving out practicals, so we've only got one to worry about for now. It seems a pretty serious situation, though, as they're talking about the possibility of it continuing until summer. And I had felt like graduating before I got married.


Mar. 3rd, 2006 03:11 pm
davidn: (Default)
((Pile)this.piles.get(((Integer)tableau.get(i % tableau.size())).intValue()))
And that's how a computer deals a hand of Solitaire. Surprisingly enough it worked first time when I typed it in.

This week I've had to begin thinking about writing cover letters and applying to companies in Boston, for the important purpose of having a job once I get there. So what have I been doing? Playing loads of Unreal Tournament 2004, naturally, after having been lent it by the over-consonanted [livejournal.com profile] allly_cs.

I was surprised by how team-oriented the game is - rather than just a simple "play through a heap of maps" single player mode like the original, you have to pay for your team members, keep them patched up and even trade members between teams, in something that bears a resemblance to Necromunda.

It's also quite a lot harder than the original - admittedly I'm playing on Experienced rather than Novice now, but all the CTF and DOM games tend to now be 20 minutes of no progress and then a frantic rush during overtime at the end. Conversely, I find the all-against-all matches dead easy, and can safely interpret opponents listed as "Unbelievably hard" as "You might actually get hurt a bit during this match." I haven't tried it online yet, though - I'm saving that for after I complete the matches in single player.

I know I'm a couple of years behind everyone else, but I'm amazed at how good it looks - half the time I get distracted by looking at the scenery rather than concentrating on playing. I'll have to look at the editor for it and see if I can get back into mapmaking again.
davidn: (bald)
There's been good news with the project today, because I finally got around to putting in a hashmap so that the program could quickly check for duplicated states instead of having to trawl through a gigantic path tree each time. Just ignore that last sentence and have a look at the screenshot.

Quite a wide screenshot )

So basically, the program reads in a rules file and represents piles of cards as they're shown there (I may make them look slightly more like cards if I ever feel like it). On a click of the Solve button, the other window pops up as the program attempts to find a path to a state where all the cards are in the foundations at the top right, while paying attention to all the rules that have been laid out.

If it finds one, it reports how many moves it took to get there and fills the solution list with the moves that it made. These can be stepped through with the "Do" button, or alternatively the "Play" button can be pressed and the cards will swap around and zoom into the foundations unaided. You can guess what the rest of the buttons do for yourself.

It's matured a lot from the initial prototype I made months ago that could intermittently solve games involving moving three cards around at random. In fact, it can now solve full Freecell reasonably easily - I'd say there was about a 50-50 chance of it working (though I still use my "Easy Freecell" game for testing, just to be safe).

I also wanted to save this screenshot in particular because it's an example of a reasonably difficult game, with a lot of low cards buried near the base of the tableau. It took 444 moves to solve it in the end, which is pretty high compared to the average 120-160, but I'm not about to find out if there are any better solutions by hand.
davidn: (Default)
I would like to take a while to sing the praises of LiDL instant pasta, which I am alternately burning myself with and eating with chopsticks at the moment. Anything "instant" sounds fairly revolting from the outset, but this is far from the studentiness of Super Noodles - it's true that it resembles a pile of grit and a mass of dry vague semicircles when you tip it out into a pan, but after adding water and boiling the daylights out of it for a few minutes, the smoke clears to reveal a mass of surprisingly edible vague semicircles. True, it's not exactly Gordon Ramsay, but it works.

The reason I'm eating with chopsticks is that apparently if you're totally useless with them like me, being forced to eat more slowly makes it feel as if you've eaten more. This is because following a number of comments from my dad around the Christmas period, I have resolved to stop moaning about how fat I perceive myself to be and do something about it. The main reason, I feel, is the lack of proximity of a DDR machine, which is pretty much the only exercise that I've got since I learned to drive. (I recently realised that I'd missed my chance to come home to my siblings and say "You lot can all move up a bike", which was very funny in my head. Does the same bike hierarchy exist anywhere but my family? Ramble, ramble.) I have resorted to doing fifty sit-ups a day, normally just before bed as I completely forget about them until then.

Surprisingly I did some work on my project yesterday - it now has a GUI instead of putting everything on the command line, but no matter how low your expectations are you'd be disappointed if I showed it to you. It looks pretty appalling, but it's in a window now, and if that's good enough for Microsoft it's good enough for me. I give up, I'm going to get a fork.
davidn: (bald)
.getNodeValue()))).addCard(new Card(Integer.parseInt(carddata.getNamedItem("suit")
.getNodeValue()), Integer.parseInt(carddata.getNamedItem("value").getNodeValue())));
...is the most horrendous line of code that I've ever written. I hope it works, because I had forgotten what it meant by the time I reached the end of the line.

I'd also like to mention to whoever understands it that I've never liked the syntax for casting in Java. It looks untidy.
davidn: (bald)
After a period of very little progress whatsoever, I'm relieved that today's work on the unstupidification of the "Solitaire Specification, Simulation and Solution System" (as I have decided to call it) resulted in making it significantly less dense. At the beginning of today it could just about solve 40-card games of Freecell, but now it can do them with very little difficulty at all - the usual number of moves it takes is from 70 to just over a hundred, compared to eight hundred earlier on. On adding a small line specifically for Freecell, which I'd rather not have to do but will work for now, I also finally witnessed it solving a full-size 52-card game. I think that deserves at least a pat on the head and a biscuit or two.

Now, one of the many disadvantages of the Modplug Central site currently being in thousands of pieces somewhere in the Pacific Ocean is that I've recently found it difficult to find the motivation to write anything new. However, yesterday I finally finished my latest set of songs (or "album", if you like, although I've always found that term vastly pretentious for the level of writing that I'm at). I'm yet to write up any commentary on them for the site, but take a look if you're remotely interested.
davidn: (skull)
I know I've not been reporting on much except work recently, but really that's about all my life will consist of in the near future. The interim report for the project is due in on Monday, where I'll have to report that my program can now solve games with about 40 cards in them, but still takes upwards of eight hundred moves to do it. I have a fair idea of how to make it a bit less appallingly stupid, but that involves a meeting with my project supervisor, and finding him is proving to be a problem.

In the meantime I've been trying to get some of the practicals out the way - in Multimedia we've been given the task of modifying videos in groups, and I thought a decent idea would be to get hold of some political broadcast (a Liberal Democrat one, perhaps) and add a laugh track to it. We'll either do that or a music video. Thankfully it's the last piece of groupwork we'll have to do this semester - in half an hour we're having the first meeting about the last presentation of the year, which was given out about two months ago and is due to be presented on Tuesday.

After that there will just be the solo practicals to clear up. I'm getting one done just now, and have just come up with this gem of a paragraph in response to "How do the expansions involved in an A* search relate to the complexity predictions?":

"To avoid an exponential growth in A*, |h(n) – h*(n)| must be below or equal to O(log h*(n)), where h(n) is the estimated cost of getting from n to the goal and h*(n) is the true cost. Therefore, the error in the estimation of cost must be of order of the logarithm of the true cost. With a problem that involves only low distances and depth of states it is difficult to determine whether this condition has been satisfied or not – however, it can be seen from the reported results that the A* search explores many more routes than the single path given by the Greedy search, and therefore increases optimality at the cost of also increasing the space complexity."

I think that's the best way of saying "I have no idea how to answer this question" that I've ever invented.
davidn: (Default)
It can solve some games with 32 cards now. It's still totally stupid, but marginally less so than it was on Friday.
davidn: (bald)
In a major breakthrough in my project, my system can now deal a game of Freecell at random, play it flawlessly itself while adhering to all the rules, and report a possible solution path back to the user.

Trouble is, if I put more than three cards into the pack then it takes all the memory in the world to actually do it. Tomorrow I think I'll work on making my code a bit more efficient, because the commonly accepted target of fifty-two cards is quite a long way off.
davidn: (skull)
After the downpour and icy winds of the last couple of days, I was amazed when coming in to St Andrews this morning to be driving through something resembling the Windows XP background. That kind of weather isn't native to this part of the country at all, and therefore the Goldfish Bowl was more of a greenhouse, making listening to the Architecture lecture all the more difficult. I can't really recall anything worthwhile from the lecturer, but I seem to remember some frightening Assembly commands being put up at some point.

Uncharacteristically for a Computer Science class, Multimedia looks like it's going to be pretty hysterical as it's mainly based on groupwork rather than sitting around being talked at. I'm not too thrilled with having to do a group presentation for the first practical, but after that there's a practical on video editing to come. The lecturer has also requested people to present some multimedia projects of their own, and I'm not really sure whether to put forward Crystal Towers or not. Other things that are being done include the madness of some people's iMovies and sixth year projects.

I also have to start thinking about what to do my presentation on at The Burn this year. I was going to do "Prince of Persia in 20 Minutes", including a talk on rotoscoping and video capture techniques as I ran through my immensely self-absorbed speed video, but I don't think that I could fill up the time very effectively, and having a presentation and video running side by side could be awkward. Besides, the quality's terrible and the licence has run out on my video software. It's likely that I'll go with a "Random Numbers" presentation so that I can send everyone to sleep, but I'd rather like to group together with a few people and do a presentation on the Junior Honours Project instead - at least then it would be something worthwhile. My only worry there is that some of the more outgoing (loud) members of the class would undoubtedly feel they could do the presentation more justice.

The project is also coming up - the one that I'm most interested in so far is a method of determining the location of a mobile device via its signal strength and therefore distance from a number of known base stations (keep reading, it gets better, I promise). If a system like that could be made accurate enough, then it's possible that the locations could be uploaded to a central server which could display a floor plan, complete with Marauder's Map-style dots that show people's locations as they move through the building. It sounds interesting, but I was concerned that I had very little experience in networking. The lecturer who set it didn't seem to see this as a problem, though. According to Al, many senior honours projects fail as miserably as the junior honours ones, so there's no worry there.

[Edited because I suddenly became stupid and got all the letters in "justify" wrong so that it read "center".]

Expand Cut Tags

No cut tags

February 2019


Most Popular Tags


RSS Atom

Style Credit

Page generated Apr. 21st, 2019 12:46 pm
Powered by Dreamwidth Studios