Is there a method of solving the game of "war" I was thinking of determining the game of war. I could write a fairly simple game that takes two "decks" of cards, and plays them against each other but I do not think this is optimal. 

Because in war the order of the cards matter it is also not a question of simply summing up the "power" of the cards. If the decks were Q-Q-J-J and K-K-1-1 then the game would go as follows even though the first player has more power:

Q-K (QJJ, K11)

Q-K (JJ, 11QK)

J-1 (J, 1QKQK)

J-1 (1J, QKQK)

1-Q (J1J, KQK)

J-K (1J, QK1Q)

1-Q (J, QK1QJK)

J-K (͏∅, K1QJK1Q)

∅ (͏∅, 1QJK1QJK)

I've been trying to think of a method of determine the winner of the game without going through the entire deck each and every time (and thus possibly going for thousands of iterations.)

If you could provide me with some pointers to start thinking about this question - that would be great!

I wasn't exactly sure where to ask this question: so if this is off topic here please redirect me.
I've been working on war for the past couple of days.

In particular I've been interested in the longest possible game, given no cycles. By backtracking, starting from the end position, I managed to avoid anything that goes into cycles. I used a dynamic greater-than relation to avoid having to decide what cards had what value from the start.

Even with those optimizations, I've only managed to create the following table, where the left column is the number of cards in play, and the right column is the length of the longest possible game:

1   0       13  62
2   1       14  467
3   3       15  85
4   7       16  261
5   9       17  107
6   17      18  &gt;=935
7   17      19  137
8   29      21  168
9   31      23  209
10  53          
11  45          
12  79          


Interestingly I found, that odd number of cards, give a much larger chance of cycles. This makes it much easier to find the longest game, as there are far fewer positions to consider. The maximum length of these games is ery close to a second order polynomial.