Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minha solução para o desafio-06 anagrama #1011

Closed

Conversation

valeriasouza28
Copy link
Contributor

Para testar a solução é necessário instalar readline-sync o npm i readline-sync, para fazer o input da palavra no console.

@ValdineiJunior
Copy link
Contributor

ValdineiJunior commented Oct 11, 2023

Valeria, a solução funcionou como nos exemplos a seguir ?

"vermelho"
ELM HO REV
ELM OH REV
OHM REVEL
LEVER OHM
ELM HOVER
HOLM VEER
HELM OVER
HELM ROVE

"oi gente"
GO I TEEN
GENE I TO
GET I ONE
EON GET I
ENG I TOE
GEE I TON
GEE I NOT
EGO I NET
EGO I TEN
GEE IT NO
GEE IT ON
GO IN TEE
GEE IN TO
GENIE TO
GONE TIE
GEE OINT
GEE INTO
GEE TONI
GINO TEE
GENE ITO
EGO TINE

Me parece que ela está identificando somente uma única palavra de cada vez exemplo:

"meat"
MATE
MEAT
TAME
TEAM

"eat"
ATE
EAT
ETA
TEA

…e que inserir uma frase teste no arquivo words.txt
@mpinheir
Copy link
Member

@valeriasouza28 seu programa dá erro se o arquio words.txt não existe.
Trate por favor este erro e termine o programa corretamente caso o arquivo não exista.

Vide resultado do teste:
Digite uma palavra : abobrinha
node:internal/fs/utils:350
throw err;
^

Error: ENOENT: no such file or directory, open './words.txt'
at Object.openSync (node:fs:603:3)
at Object.readFileSync (node:fs:471:35)
at Object. (/home/marcelo/teste-solucoes/valeria/valeria.js:46:19)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
at node:internal/main/run_main_module:23:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: './words.txt'
}

Copy link

github-actions bot commented Nov 9, 2023

PR marcado como obsoleto devido à falta de atividade. Fechamento automático ocorrerá em 5 dias na ausência de nova atividade.

@github-actions github-actions bot added the stale label Nov 9, 2023
@github-actions github-actions bot closed this Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants