Monday, May 31st 2010 / Web
<?
/******************************************************************
* ProjectEuler.net * Problem 8 * 2010-05-31 * Martin Caine *
******************************************************************/
$string = '73167176531330624919225119674426574742355349194934';
$string .= '96983520312774506326239578318016984801869478851843';
$string .= '85861560789112949495459501737958331952853208805511';
$string .= '12540698747158523863050715693290963295227443043557';
$string .= '66896648950445244523161731856403098711121722383113';
$string .= '62229893423380308135336276614282806444486645238749';
$string .= '30358907296290491560440772390713810515859307960866';
$string .= '70172427121883998797908792274921901699720888093776';
$string .= '65727333001053367881220235421809751254540594752243';
$string .= '52584907711670556013604839586446706324415722155397';
$string .= '53697817977846174064955149290862569321978468622482';
$string .= '83972241375657056057490261407972968652414535100474';
$string .= '82166370484403199890008895243450658541227588666881';
$string .= '16427171479924442928230863465674813919123162824586';
$string .= '17866458359124566529476545682848912883142607690042';
$string .= '24219022671055626321111109370544217506941658960408';
$string .= '07198403850962455444362981230987879927244284909188';
$string .= '84580156166097919133875499200524063689912560717606';
$string .= '05886116467109405077541002256983155200055935729725';
$string .= '71636269561882670428252483600823257530420752963450';
$max = 0;
for( $i=0; $i<996; $i++ )
{
$sum = intval( substr( $string, $i, 1 ) ) *
intval( substr( $string, $i+1, 1 ) ) *
intval( substr( $string, $i+2, 1 ) ) *
intval( substr( $string, $i+3, 1 ) ) *
intval( substr( $string, $i+4, 1 ) );
if( $sum > $max )
{
$max = $sum;
}
}
echo $max;
?>
Read the full article...
Monday, May 31st 2010 / Web
<?
/******************************************************************
* ProjectEuler.net * Problem 7 * 2010-05-31 * Martin Caine *
******************************************************************/
// create an array to store the primes
$primes = array();
$primes[] = 2;
// count the primes
$i = 1;
$n = 2;
// break when we get to 10001
while( $i < 10001 )
{
$n++;
$isPrime = true;
foreach( $primes as $prime )
{
if( ($n/$prime) == (int)($n/$prime) )
{
$isPrime = false;
break;
}
}
if( $isPrime )
{
$primes[] = $n;
$i++;
}
}
echo $primes[10000];
?>
Read the full article...
Monday, May 31st 2010 / Web
Another pretty easy one from
Project Euler, puzzle 4 simply required building an array of values based on calculations and sorting them to find the highest values:
Read the full article...
Monday, May 31st 2010 / Web
Someone I'm following on Twitter posted a link to an interesting site called
Project Euler. It's full of interesting maths puzzles which are designed in such a way that you should create a program to calculate the result for you.
Read the full article...
Thursday, May 27th 2010 / XNA
I've spent the last few days reworking some of the core shaders in my XNA games and in particular working on the shaders that render the cars in our racing game Shadow Racers.
Read the full article...
Tuesday, May 25th 2010 / Blog
Last night I sat down for two hours with my Wife Laura and together we watched the final episode of Lost after watching the full six seasons together over the past two years.
Read the full article...
Friday, May 21st 2010 / Web
Early during the development of my XNA game engine I started using a custom model processor which is integrated heavily into the deferred renderer and uses obj files as it's input.
Read the full article...
Thursday, May 20th 2010 / Blog
Just a little update here as I did manage to get my Intensity Pro working last week after some fiddling.
Read the full article...
Tuesday, May 18th 2010 / Blog
I was searching for some information last night on how I would go about connecting an Xbox 360 to a 27" iMac and after hours of searching I found a solution.
Read the full article...
Saturday, May 15th 2010 / Blog
I found myself searching for a way to export .obj files from Maya 2011 this week and found very little information regarding the subject. It turns out the functionality is inbuilt but just hidden away!
Read the full article...
Thursday, May 13th 2010 / Blog
My Brother's band
Roadkill played their first gig in a while lastnight and I have to say they were pretty tight!
Read the full article...
Tuesday, May 4th 2010 / Blog
For those of you out there who are Twitter users I have three accounts on there which I try to regularly keep updated (ok, not so much yet but I do plan to update them more often).
Read the full article...
Monday, May 3rd 2010 / Blog
Well, here's a quick catch up after my first post regarding the Blackmagic Design Intensity Pro.
Read the full article...