Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
NB. Explicit definition. Can be converted by 13 : '...' -- but it will give lots of [:
e=: 3 : 'FF-.~,|:'' '',~(c,~>.l%c=.>.%:l=.#t)$!.FF t=.'' ''-.~y'
NB. Tacit definition, step by step
t=: -.&' ' NB. text: without blanks
c=: >.@%:@# NB. number of cols
d=: (>.@(%~#),[)~c NB. dimension: rows,cols
m=: (d $!.FF ])@t NB. matrix of letters
w=: ,@|:@(' ',~m) NB. new words with blanks between them
h=: FF-.~w NB. hackerrank encryption
NB. or the same in one line ;)
h=: FF-.~,@|:@(' ',~(((>.@(%~#),[)~>.@%:@#)$!.FF]))@(-.&' ')
echo (e ,: h) 'if man was meant to stay on the ground god would have given us roots'
NB. imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
echo (e ,: h) 'hello dear world!'
NB. horl edwd leo! larecho h h 'now is the time for all good men'
NB. --> nowis theti mefor allgo odmen
Решаем задачу Hackerrank — «Encryption» (используя Go)