Preciso fazer um trabalho, onde meu programa vai receber um arquivo com as especificações de uma labirinto, e eu devo retorna o menor caminho necessário para encontrar a saída.
Minha duvida é que o arquivo está da seguinte forma:
BB (Posicao inicial do rato)
A: B w w K
B: C w A L
C: D w B M
D: E w C N
E: F w D O
F: G w E P
G: H w F Q
H: I w G R
I: J w H S
J: w w I T
K: L A w U ... (continua)
(w é um obstaculo)
Arquivo com o resultado do labirinto
Como posso transforma isso em uma matriz, onde caminho livre igual a 0 e obstaculo igual a 1?
Preciso fazer essa conversão para usar o algoritmo de BFS e descobrir o menor caminho até a saída.
Estou tentando rodar um projeto de um jogo na minha maquina porem o mesmo pede para adicionar o log4cxx 0.10.0, realizei pesquisas na internet a respeito mas até agora nada, Encontre para baixar nesse site https://logging.apache.org/log4cxx/1.0.0/download.html porem não sei se devo instalar ele no windows porque ao exportar ele no projeto as depêndencias que precisam dele ficam informando o erro log4cxx.logger.h no such file or directory. a linguagem que estou usando e C++
Fala galera.
Espero que todos estejam bem.
Seguinte: Tenho um arquivo xml onde alguns campos estão com : (dois pontos), como o exemplo abaixo:
<item>
<title>
d sa dsad sad sadasdas
</title>
<link>
dsadas dsa sad asd as dsada
</link>
<pubDate>sadasdasdsa as</pubDate> <dc:creator>
d sad sad sa ad as das </dc:creator>
</item>
I'm new to C and C++ programming, can anyone give me a hint on what I'm doing wrong here. I'm trying to write to concat function that takes to pointers to chars and concatenates the second to the first. The code does do that, but the problem is that it adds a bunch of junk at the end.
For instance, when passing the arguments - "green" and "blue", the output will be "greenblue" plus a bunch of random characters. I also wrote the strlen function that strcat uses, which I will provide below it for reference. I'm using the online compiler at InterviewBit The exact instructions and specification is this:
int main(int argc, char** argv)
{
const int MAX = 100;
char s1[MAX];
char s2[MAX];
cout << "Enter your first string up to 99 characters. ";
cin.getline(s1, sizeof(s1));
int size_s1 = strlen(s1);
cout << "Length of first string is " << size_s1 << "\n";
cout << "Enter your second string up to 99 characters. ";
cin.getline(s2, sizeof(s2));
int size_s2 = strlen(s2);
cout << "Length of second string is " << size_s2 << "\n";
cout << " Now the first string will be concatenated with the second
string ";
char* a = strcat(s1,s2);
for(int i = 0; i<MAX; i++)
cout <<a;
// system("pause");
return 0;
}
//strcat function to contatenate two strings
char* strcat(char *__s1, const char *__s2)
{
int indexOfs1 = strlen(__s1);
int s2L = strlen(__s2);
cout <<s2L << "\n";
int indexOfs2 = 0;
do{
__s1[indexOfs1] = __s2[indexOfs2];
indexOfs1++;
indexOfs2++;
}while(indexOfs2 < s2L);
return __s1;
}
//Returns length of char array
size_t strlen(const char *__s)
{
int count = 0;
int i;
for (i = 0; __s != '\0'; i++)
count++;
return (count) / sizeof(__s[0]);
Não consigo abrir o arquivo de desenvolvimento de um aplicativo,
que foi feito pela themeforest(o template).
Será que ele não é compatível com as IDE's que eu tô tentando abrir, já tentei no:
Notepad++
Visual Studio (Com o ionic instalado)
Android Studio
Esse é um dos erros que aparecem:
"the archive not is displayed in the editor because it is either binary or uses unsupported text encoding"
Boa noite.
Preciso fazer um trabalho, onde meu programa vai receber um arquivo com as especificações de uma labirinto, e eu devo retorna o menor caminho necessário para encontrar a saída.
Minha duvida é que o arquivo está da seguinte forma:
BB (Posicao inicial do rato)
A: B w w K
B: C w A L
C: D w B M
D: E w C N
E: F w D O
F: G w E P
G: H w F Q
H: I w G R
I: J w H S
J: w w I T
K: L A w U ... (continua)
(w é um obstaculo)
Arquivo com o resultado do labirinto
Como posso transforma isso em uma matriz, onde caminho livre igual a 0 e obstaculo igual a 1?
Preciso fazer essa conversão para usar o algoritmo de BFS e descobrir o menor caminho até a saída.
Obrigado.
labirinto01a.pdf
Compartilhar este post
Link para o post
Compartilhar em outros sites