Split a number into a list of digits in Prolog

Viewed 6562

I've been having trouble trying to split numbers into lists using Prolog, e.g. 123456 becomes [1,2,3,4,5,6].

Can you please help me work out how to do this?

2 Answers
Related