Can anyone explain the motives of this chess engine? I just played a game against a fairly low-level chess engine, and it made some really weird moves that i cannot see the logic behind. The game goes as follows:

[fen ""]
1. a4 d5 2. d4 Qd6 3. c3 Qg6 4. Bf4 Qxb1 5. Qxb1 Kd8 6. e3 Bd7 7. Bb5 Bxb5     8.
axb5 e6 9. Ne2 Be7 10. g3 Nd7 11. O-O g5 12. Be5 f6 13. Bxf6 Ndxf6 14. Qd3
Kc8 15. c4 Bb4 16. cxd5 Nxd5 17. Qc2 Nge7 18. e4 Nb6 19. Rfc1 c5 20. dxc5 Nd7
21. b6 Nxc5 22. bxa7 Re8 23. Qc4 Nc6 24. Nd4 Be1 25. Qxc5 Bd2 26. Rc2 Rxa7
27. Rxa7 Be1 28. Nxc6 Bxf2+ 29. Kxf2 Kc7 30. b4 Rf8+ 31. Ke3 Rf3+ 32. Kxf3
g4+ 33. Kxg4 h5+ 34. Qxh5 Kd7 35. e5 Kc8 36. Na5+ Kb8 37. Rxb7+ Ka8 38. Rc8#


The first weird move is 4. Bf4 Qxb1 which exchanges the queen for a knight.

The second illogical move is 26. Rc2 Rxa7, where black sacrifices their rook for a pawn, while already down a queen.

With 28. Nxc6 Bxf2+, black decides not to retake the knight and instead sacrifices a bishop to take a pawn and deliver a meaningless check.


Ke3 Rf3+ gives away black's rook, leaving the computer with no major pieces against both my rooks and a queen. The computer then proceeds to check me twice with pawns, both of which i take.
e5 Kc8 Is the most stupid move, leaving black open to a forced checkmate.


Considering that this computer is set to 'hard' difficulty, i am very dissapointed. Does anyone have any explanation for what might have caused it to make these pathetic moves? I would like to think that it is not designed to let me win, however by the looks of things it is.
The engine is only looking ahead one move. Most of these blunders are giving check, but are poorly constructed. It seems that the engine is programmed to think that giving check is always good, but does not check to see if its pieces are defended.