Thursday, November 25, 2010

Thanksgiving

Well thanksgiving came up quick.  I rented Fable III and have been playing it almost nonstop.  I  beat it yesterday.  It's a good game, but there seems to be something lacking in its writing.

I like the game mechanics.  The magic and weapon mechanics feel like an improvement on Fable 2, but everything you do in Fable 3 just seems to feel less important than it did in Fable 2.  I saw one review say it was good, but less magical, and I'm inclined to agree.

My family finally got me off the tv a couple of hours ago and I've been working on Project Euler in my extra time.  I'll post my solutions to problems 16, 20, and 48 later.

Tuesday, November 16, 2010

Coding Journey: Google AI

I've spent the past few days going over every bit of my code for the Google AI Challenge.  I've written and rewritten everything over and over and I finally have something that actually works.  If it weren't for output files, I couldn't have figured out any of my bot's errors.

Well, Thanksgiving's coming up and I'll be heading home on Friday after my calc test.  It's a sixteen hour drive home, but at least there's some good food at the end of it.

Thursday, November 11, 2010

Good Times

I finally got Fable working and have wasted hours playing and modding it.  It was a strange kind of relief, doing nothing for so long.  Anyway, that and the fact that a Microsoft rep gave me a copy of Halo Reach in my comp sci class today makes for a satisfying twenty four hours.


Wednesday, November 10, 2010

Coding Journey: Euler Problem 22

Last night I decided that I wanted to install some of my old games on my computer.  I found out that I've lost the file I had saved containing all of the keys to my pc games (all legal games and keys, fyi).  So many keys lost!

I hate drm.  It makes games more trouble than they're worth.  It still angers me to no end that I can't play Half-Life or Portal without an internet connection.

Anyway.

I spent some time last night and this morning working on problem 22 of Project Euler.  It's in C++ because I figured the speed would be an advantage in processing everything.

It took me a while to figure out the answer, mostly because I was mistakenly using the ASCII values of each word in my calculations rather than alphabetic values (e.i. a = 1, b = 2, c = 3, ect).

Once I got it working, I went through and tried to comment most of it, but I have to say this whole program seems clunky to me.  It works, but I think I could've done a better job.  Anyway, here's my solution, for your coding pleasure.

Tuesday, November 9, 2010

College Days

I thought that in college I'd be going to parties, playing music, and hanging out with non-nerdy people.  Instead, I find myself helping my comp-sci friends with programming assignments and coding in my free time.  Don't get me wrong, I love the comp-sci people, but the de-nerdening I had expected for in college is not forthcoming.

I've spent the bulk of my last two days trying to learn Python.  I worked out this script to solve problem 21 of Project Euler.
#!\usr\local\bin\python

def sum(a):
        divTot = 0
        for k in range(1,a):
                if (a%k) == 0:
                        divTot += k
        return divTot

amicableNumbers = []
total = 0

for i in range(0, 10000):
        temp = sum(i)
        if temp < i:
                if (sum(temp) == i):
                        amicableNumbers.append(i)
                        amicableNumbers.append(temp)

for k in range(0,len(amicableNumbers)):
        total += amicableNumbers[k]

print total
  It takes a few seconds to work, but it does the trick.