Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require( 'fs' ), rn = '\r\n'
- var file = fs.readFileSync( 'morzeabc.txt', 'utf-8' ),
- DeCode = new Map(), betű, morzejel
- file.split( rn )
- .splice( 1 )
- .forEach( ξ => {
- [ betű, morzejel ] = ξ.split( '\t' )
- DeCode.set( morzejel, betű )
- })
- file = fs.readFileSync( 'morze.txt', 'utf-8' )
- console .log(
- file.split( rn )
- .map( ξ => ξ
- .split(';')
- .map( ξ => ξ
- .split( ' '.repeat(7) )
- .map( ξ => ξ
- .split( ' '.repeat(3) )
- .map ( ξ => DeCode.get( ξ ) )
- .join ( '' )
- )
- .join( ' ' )
- )
- .join(': ')
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement