I'm doing a program that features several dogs, and I want to do it in a way that is faster to write down the characteristics of the dogs. For example, the following code
raca(pitbull).
raca(shiba).
raca(boxer).
raca(poodle).
raca(bullte_terrier).
sexo(macho).
sexo(femea).
cor(castanho).
cor(preto).
cor(branco).
cor(tricolor).
cor(pintado).
cor(malhado).
pelo(longo).
pelo(curto).
peso(15kg).
print(X):-
write(X).
cao(trovao):-
sexo(macho),
raca(pitbull),
cor(marrom),
pelo(curto),
write('raca: '),nl,
write('nascimento: 1999'),nl,
write('cor: marrom'),nl
write('pelo: curto').
What I want is a way of not writing I can print the variable that is storing the information. Example
X = cor(marrom),
write(cor: X).
and there it would be printed in the terminal "color: brown", but it is not working, I do not know how to put the variable in write. Can you help me?