Archive for April, 2007
You are now browsing the archive for April in 2007.
Begin by killing off the ghouls, and then move north. Make sure to take every sidepath that you can find, since there are many loyal units to rescue. Your ghouls will probably be mostly in the way, so don’t worry too much about healing them, except for cannibalizing after battles. Your abominations, however, should be kept alive at all costs. These are vital for the final battle.
Even though you are periodically attacked from behind, you shouldn’t rush this stage. The attacks are all weak, and you will probably survive all of them without losses if your Death Coiling is good.
It is worthwhile to assault the Dreadlord and his golems in order to rescue your two meat wagons. They are useful, not only against Nerubian Towers, but more so as fire support. Just make sure that you do not leave them too far behind; the attacks in the back might damage them, and your only way of repairing them is waiting for them to regenerate.
There are no real traps in this mission, and so your Shades will not work well for scouting, especially considering there are three or so hostile Shades who can spot them. Your Shades will do more good if you leave them beind in crossings, so that you can spot rear-attacks early on.
When you face the huge abomination in the end (I don’t remember his name — Bloodfeast?), you have two options. You can either just attack-move against him, which should work unless you’ve suffered major casaulties. The other option is using the Staff of Reanimation, which you should have picked up earlier in this mission, Arthas’s Animate Dead and the Necromancers’ Raise Skeleton in order to create free minions, which you can send in indefinitely.
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
Find the largest palindrome made from the product of two 3-digit numbers.
There is probably an elegant way of doing this, but I prefer the easier method of brute force. This is a Perl script that calculates every product of three-digit numbers and saves all of the palindromic numbers in a list. It then sorts the list in descending numerical order and prints the first element in the list.
1
2
3
4
5
6
7
8
9
10
| my @l; # the list for all the palindrom numbers
for ( my $n = 999; $n > 99; $n-- ) { # do for 100 to 999
for ( my $m = $n; $m > 99; $m-- ) { # do for 100 to $n
if ( $n*$m == reverse( $n*$m ) ) { # if the product is a palindrom..
push @l, $n*$m; # ..add it to the list
}
}
}
@l = sort { $b <=> $a } @l; # sort @l numerically with the largest number first
print $l[0]; # print the first element (the largest number) |
The script finishes in about a second. Note line 3, the second for loop. Since $n times the numbers higher than $n have already been multiplied earlier in the loop, these can be left out to save time.
This is a really long mission. Start by pulling the speed down to Slow, since you’re defending or attacking at three fronts simultaneously. Now, start making units. Arthas needs only abominations, Sylvanas needs Banshees and Kel’Thuzad needs Necromancers. In the beginning, though, build some ghouls in Arthas’s and the lich’s crypts to get up an army quickly.
Unless you are very skilled, you will only be able to attack at one front at a time. Arthas will do a good job defending his side by himself as long as you put a ghoul near the Circle of Power, but Kel’Thuzad will need some help from you. His front is the most difficult one to defend. Cast Frost Nova as much as you can, and set Raise Skeleton to auto for the Necromancers. Cripple some units, too, since you will have more than enough collective mana. The skeleton warriors should be kept as a shield around the lich and the necromancers.
The key to fighting with Sylvanas is possessing everything stronger than a Footman, especially the Knights. On the other fronts you have the problem of Paladins healing the knights, but guess what happens if they have no knights to heal — that’s right, they can’t heal them! Using this strategy, you should be able to destroy all the bases on Sylvanas’s side quickly. No more villagers will try to escape through Sylvanas’s mountain pass any more, so therefore I just did a suicidal attack with the units I had left on the center and made sure that Sylvanas slipped through to Kel’Thuzad’s side. Her Life Drain and fire power was a considerable aid.
With only two fronts to defend, you can attack simultaneously. The key is not to attack the old-fashioned way. It’s not hit-and-run either, it’s more of a hit-and-die. As soon as you have slaughtered some villagers and raised them with your Necromancers, send the skeletons on a suicidal mission to destroy a farm. Even if you only damage it once, you will have won, because your skeletons are free and the farms are never repaired. You can do the same with Arthas. Just send him and some Abominations to destroy farms. Animate Dead to get them up again and do even more damage.
When only the centre Paladins are left, it is easy to destroy their base through a combined assault, since you now have 90 food to play around with.
Notes:
- Put your Shades at important crossings in order to warn yourself of escaping villagers.
- Killing your own Shades will not help, since they do not count against the food limit in this mission.
- You can get nice items by seeking out and killing some heroes — Arthas has a Mountain Giant, Kel’Thuzad has an Archmage and Sylvanas has some archer with Starfall.
- Make sure to always be stocked up with healing scrolls, since you have almost unlimited cash.
- When all the villages on one side have been destroyed, there won’t be any more attacks. You can keep pushing units to the center, or get them over to another side to help.
- Your units prioritize combat units over peasants, and might let them slip through fighting. To avoid this, let one or two ghouls stand closer to the mountain pass.
- Human units become Invulnerable as soon as they touch the circles.
- Don’t give up. This is a hard mission on par with the timed missions in Reign of Chaos, but it is possible.
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 317584931803?
To calculate the prime factors, I loop through the prime numbers, dividing the number with each if it is divisible. I used a modified version of my prime calculator:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| my $m = 3175849318035832905;
my @primes = ();
my $i = 1, $b = 0;
while ( $i < $m ) { # looped until the final prime factor has been found
$i++;
foreach (@primes) {
if( ! ( $i % $_ ) ) {
$b = 1;
next;
}
}
if ( $b ) {
$b = 0;
} else { # if it is a prime
push @primes, $i;
while ( ! ( $m % $i ) ) { # as long as $m is divisbible by the prime
print "$i \n"; # print the prime (since it's a prime factor)
$m /= $i; # divide $m by the prime
}
}
} |
The last number printed is the highest prime factor. Explanations for the modifications are in the code.
The following code sorts a given string internally in order of the characters’ ASCII values.
print sort split '', <STDIN>
A per-line analysis of the code wouldn’t say very much. This is the code with brackets added:
print( sort( split( '', <STDIN>) ) )
First, the input (<STDIN>) is split into an array with split. The first argument, '', means that it splits every character. sort sorts it in ASCII order, and the result is finally printed. The only flaw is that the linebreak (ASCII 10) is put first, and so you see a double linebreak between the input and the output.
If you take your time on this mission, it is very easy. I finished it without using any of the gold at all, and had no problems.
First, choose which party to push and keep to that. I recommend Vashj’s Naga, since Vashj can destroy one of the generators in case you don’t want to risk your assassins. The fact that Kael and Illidan are periodically attacked is irrelevant, since they can be fended off without any casaulties as long as you micro-manage the damaged spellbreakers and firestorm all over the place.
Lady Vashj and her army should make it to the Mistress of Pain without any losses, too. Make good use of the turtles’ digestion systems and their siege attacks against buildings. Also, don’t be afraid to cast Crushing Waves and Frost Bolts with your Naga Royal Guards. Those Frost Bolts look really nice on Battleships. Do not attempt to take on the Mistress of Pain alone. Instead, activate the bridge to the west of the last Orc encampment and wait there for Illidan’s and Kael’s army.
Illidan and Kael should not lose any units, either. It’s a good idea to go slaughter the butcher for some nice tomes.You will probably lose some Spellbreakers there, but you will get them back when he drops his Rune of Resurrection. Don’t forget to attack the units just north and south of the well first, since you’re really going to have problems if they attack your priests and sorceresses from behind.
The Orc bases should be no problems, either. If you feel that you want to be on the safe side, you can walk the assassins in and have them Hide on strategical positions. In the last base, you can catch all of the Orcs, including the hero, behind their own buildings while picking them off with your ranged units. The Master of Torture can be beaten easilly if you just attack-move your units in there.
Probably the same thing can be said about the Mistress of Pain, but her Charm is nasty, and so I decided to hit-and-run until she and all of her units were dead. To do so, first place your army well away from her, e.g. by some well — her units don’t give up easily. Next, summon two Sea Elementals (Naga Royal Guards) and two Spirit Wolves (the Draeni assassin hero) and send them up to the attack one unit. Your goal is to kill at least one unit with every wave, since you don’t lose anything but the Mistress cannot replace her units.
Let Kael, Illidan and Vashj go behind the units. Illidan should survive going melee and mana-burning while you micro Vashj’s Forked Lightning and Kael’s Banish and Firestorm (or is it Firestrike? I don’t remember). You should be able to kill them all without any hero dying in a few waves.
Next is Magtheridon. He’s a little harder, and brute force won’t break him. I used the same tactic as against the Mistress of Pain, and it worked. It just took a lot more time. Remember not to waste time attacking the Infernals, since they are temporary summons.
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …
Find the sum of all the even-valued terms in the sequence which do not exceed one million.
There are more elegant solutions than brute perl force, but this is the fastest as long as time thinking is counted. This is my Perl Fibonacci calculator, slightly modified to add the even numbers together. The added lines are commented in the code:
1
2
3
4
5
6
7
8
9
10
11
| my @fibonacci = (0,1);
my $n = 1;
my $s = 0; # set the sum to 0
while ($n < 1000000) {
if ( ! ( $n % 2 ) ) { # if the fibonacci number is even:
$s += $n; # add the number to the sum
} # end the if-statement
$n = $fibonacci[@fibonacci - 1] + $fibonacci[@fibonacci - 2];
push @fibonacci, $n;
}
print $s; # print the result |
First, note that the sequence calculated here begins “1, 1, 2″ as opposed to “1, 2″ which the mission states. This doesn’t matter, though, since the additional 1 is an odd number and therefore not included in the sum anyway.
Second, the RAM requirements should be noted. I modified an old script in order to save time, but that script still saves all of the calculated numbers in a list. If this was about larger numbers, it would have had a significant impact on calculation time.
Project Euler is a cool site that I just stumbled upon. It contains problems which require both mathematics and programming to succeed. I decided to start writing a guide for Project Euler for those who need a little help. I will never write the complete answer, since you’ve got to do something by yourself. The first problem is straight-forward:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
You can solve this either through mathematics or through programming. If you want to go the mathematician’s way, you must first write an expression for it. The sum of the series is essentially the sum of two other series; the multiples of 3 below 1000 and the multiples of 5 below 1000. For the sum of these series, use the following formula:

n is the number of elements in the series. Therefore it equals 333 (999/3) for the first sum and 199 (999/5, rounded down) for the second one. a1 is the first element, i.e. 3 and 5, respectively. an is the last element. That is 999 for the first (333*3) and 995 for the second (199*5). Now, we have:

Note, however, that there is a flaw here. The numbers which are multiples of both 3 and 5 are counted twice! In order to fix this, we need to find out which numbers are multiples both numbers. Of course, those numbers are the numbers divisible by the lowest common denominator of 3 and 5. That is 15. We will then subtract all numbers which are multiples of 15 in a similar way:

You’ve got to calculate it yourself.
It is much easier and faster (but less cool) to write a program which does the job for you. This perl script does the task well:
1
2
3
4
5
6
7
| my $s = 0;
for ( my $n = 0; $n < 1000; $n++ ) {
if ( ! ( $n % 3 && $n % 5 ) ) {
$s += $n
}
}
print $s; |
- Line 1 sets
$s (the sum) to 0, just to be sure.
- Line 2 starts the loop which will loop for
$n (the current number) from 0 to 999.
- Line 3 checks whether
$n is divisible by either 3 or 5.
- Line 4 adds
$n to $s
- Line 7 prints the final sum.
In order to ease template writing for bbPress, i compiled a list of all the template functions in the current version (bbPress 0.8.1). It was done swiftly with grep -oe ^function.*\) bb-includes/template-functions.php | sort > functions.txt.
(more…)
I was going to expand my guide archive for Hellbound Hackers, but when I went to HellboundHackers.org I saw the following:
This Account Has Been Suspended
If you are the owner of this web site, please contact the billing/support department as soon as possible.
Telephone: +44 (0870) 922 0465
Contact Us: http://support.ukhost4u.com/
Web Site: http://www.ukhost4u.com/
This must have happened recently — Google currently has a working cache from 11 Apr 2007 23:21:02 GMT. Is this going to be like the GoDaddy/Nmap incident? Hopefully the site will get back up soon. It had a lot of interesting missions.
Update 19:30 GMT: The site now returns a 403 Forbidden error.
« Later Posts —
Earlier Posts »