analuisavilas Posted October 27, 2015 at 10:54 PM Report Share #589222 Posted October 27, 2015 at 10:54 PM (edited) Boa noite, Tenho o seguinte problema: - criar um labirinto ou seja com uma matriz com estes caracteres : '$','w','B','0' aleatoriamente. Não sei como resolver este problema Tentei desta maneira, mas não dá void labirinto_aleatorio(int matriz[][Dim_Coluna]) { int linha=0,coluna=0,v; char caracteres[4]= {'$','w','B','0'}; srand(time(NULL)); for(linha=0 ; linha < Dim_Coluna ; linha++) matriz[linha][coluna]=rand()%4; printf("%d",matriz); } Podem me ajudar? Obrigada Edited October 27, 2015 at 11:18 PM by thoga31 Tags code + GeSHi Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted October 27, 2015 at 11:13 PM Report Share #589224 Posted October 27, 2015 at 11:13 PM esse código não cria um labirinto, só atribui um valor numérico entre 0 e 3 aos elementos da matrix para criar um labirinto, necessitas de "caminhos" pensa em como criar um "caminho", e se tiveres dificuldade nisso, apresenta como pensas fazer para seres direccionada da melhor maneira IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now