There was this old game (J2ME) but I cannot find it now in google.
The name was “Capture”.(Accoring to the comments it’s more like “Jezzball”)
I tried to implement this game but I cannot come up with a good algorithm and data structues.
The ideas of the game is,

Can anyone suggest an algorithm?
(I hope the ideas is clear)
There was this old game (J2ME) but I cannot find it now in google.
Share
By algorithm, I guess you mean the design of the program. You would end up using several algorithms in the final game.
You would design this the same way you’d tackle any piece of software (there’s nothing special about it being a game). First, you’d start with a specification, which you have. Then, you’d break it down into logical units:
and then you’d consider how they interact. For example, when the player moves, the board is updated. When an enemy moves, it checks the board to see if it has collided with the player. And so on.
As for the structure of the game, every game I’ve worked on does this:
In your case, the
worldwould be the board, the player and the enemies (it would also include the UI). There is a hierarchy here, the player and the enemies belong to the board, so you get:and
draw_boardis:and
update_board:The
update_anddraw_functions can be further broken down. This is know as top down design.Designing the whole game for you would require a huge answer, and it would take away from you the fun of figuring these out for yourself. Hopefully this will get you started.