*(I've copied and pasted this from the Smogon.com explanation) *Type depends on the user's IVs, with the following formula:

Type = (A + B + C + D + E + F) * 15 / 63

* If the IV of HP is odd, then A = 1.

* If the IV of Attack is odd, then B = 2.

* If the IV of Defense is odd, then C = 4.

* If the IV of Speed is odd, then D = 8.

* If the IV of Special Attack is odd, then E = 16.

* If the IV of Special Defense is odd, then F = 32.

* If the IV of any are even, then their variable = 0

This number is rounded down, and then determined by the following table:

0 = Fighting

1 = Flying

2 = Poison

3 = Ground

4 = Rock

5 = Bug

6 = Ghost

7 = Steel

8 = Fire

9 = Water

10 = Grass

11 = Electric

12 = Psychic

13 = Ice

14 = Dragon

15 = Dark

Power depends on the user's IVs, as well, with the following formula:

Power = (U + V + W + X + Y + Z) * (40 / 63) + 30

* If the IV of HP divided by 4 has remainder 2 or 3, then U = 1.

* If the IV of Attack divided by 4 has remainder 2 or 3, then V = 2.

* If the IV of Defense divided by 4 has remainder 2 or 3, then W = 4.

* If the IV of Speed divided by 4 has remainder 2 or 3, then X = 8.

* If the IV of Special Attack divided by 4 has remainder 2 or 3, then Y = 16.

* If the IV of Special Defense divided by 4 has remainder 2 or 3, then Z = 32.

* If the IV of any divided by 4 has remainder 0 or 1, then their variable = 0

In other words, if the IV is 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, or 31, you use the number given, otherwise, use 0.

The final number is rounded down, and that is the power of your Hidden Power.

See? There's no way to make it work for you, it's just chance. If you're interested in Hidden power, then you can check out this guide which will clear it up further for you.

http://www.gamefaqs.com/boards/genmessage.php?board=925601&topic=41844147

I can then the close quarter beats them.