Bejewelled game logic

Hi,

Can anyone help me to do bejewelled type game?

Thanks.