If this interests you, please do check out prolog. Declarative languages let you do something quite similar. In particular, they let you specify what you want the computer to give you rather than what you want the computer to do.
Believe it or not, a very good example of such a language which you might be familiar with is SQL.
Believe it or not, a very good example of such a language which you might be familiar with is SQL.