I'm making a chess-like game and, in order to make the various moves, I want to read some user input like "11-12" to move the piece located at the "coordinates" 1-1 to the position 1-2. I want to convert the string "11-12" to a list like [1,1,-,1,2]. I would like to end up with something like this:
...
read(Play),
convert_play_to_list_L(Play, L),
element_at(StartX,L,1),
element_at(StartY,L,2),
element_at(EndX,L,3),
element_at(EndY,L,4),
...
example: Play = "1112" , L = [1,1,1,2] , StartX = 1 , StartY = 1 , EndX = 1 , EndY = 2