24
\$\begingroup\$

Your task is to print this exact text:

אבגדהוזחטיכךלמםנןסעפףצץקרשת

(You are allowed to print a trailing newline)

SHA256 hash of the UTF-8 encoding of the text:

0ab6f1e0bf216a0db52a4a5a247f95cba6f51496de7a24dfd01f3985dfcf6085

Base64 encoding:

15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq

Rules

  • You can't use a builtin outputting this text.
  • Standard loopholes are disallowed.
  • This is , so the shortest answer wins.

Good luck!

\$\endgroup\$
19
  • 5
    \$\begingroup\$ I noticed the code points are not directly in order. You have 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1499, 1498, 1500, 1502, 1501, 1504, 1503, 1505, 1506, 1508, 1507, 1510, 1509, 1511, 1512, 1513, 1514. I don't know very much about Hebrew, so could you confirm this is indeed intentional? \$\endgroup\$
    – DJMcMayhem
    Oct 21, 2016 at 17:27
  • 12
    \$\begingroup\$ @DJMcMayhem Unicode list final letters before normal letters but in the text in the question normal letters are listed before. It was not really intentional, but at least it encourage answers that are not as boring as print(map(chr, range(x, y))) \$\endgroup\$ Oct 21, 2016 at 17:29
  • 6
    \$\begingroup\$ אני מדבר עברית! \$\endgroup\$
    – AAM111
    Oct 22, 2016 at 3:34
  • 6
    \$\begingroup\$ Aleph null, aleph one, aleph 2, ... \$\endgroup\$
    – user41805
    Oct 22, 2016 at 18:21
  • 2
    \$\begingroup\$ @Angs That's because it really doesn't match. echo 15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq | base64 -d | sha256sum produces f1d4b9c12a197912a4bdb80fb3e4d3fad5a0d9b7edd243fae7b2ab3450618036. \$\endgroup\$
    – hvd
    Oct 23, 2016 at 15:07

27 Answers 27

27
\$\begingroup\$

MATLAB, 52 51 bytes

[cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']

Example use:

>> [cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']
ans =
אבגדהוזחטיכךלמםנןסעפףצץקרשת

Explanation

'CCCCCCCCCDADDAEADCDAEADCCC'-66 produces the array [1 1 ... -1 2 1 1 1], which contains the consecutive differences between the codepoints of the desired characters.

[1488 ...] prepends 1488, so the array is now [1488 1 1 ... -1 2 1 1 1].

cumsum(...) computes the cumulative sum: [1488 1489 ... 1514].

[... ''] concatenates with the empty string. This has the effect of converting to char (and is one byte shorter than char(...))

\$\endgroup\$
0
20
\$\begingroup\$

Jelly, 22 21 20 bytes

27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ

Try it online!

Idea

If we subtract 1487 from each code point, we get the array R that follows.

1 2 3 4 5 6 7 8 9 10 12 11 13 15 14 17 16 18 19 21 20 23 22 24 25 26 27

That's just the range from 1 to 27, but not in ascending order; the pairs (11, 12), (14, 15), (16, 17), (20, 21), and (22, 23) have been swapped.

If we take the ascending range and add 2 to 11, 14, 16, 20, and 22, we get the array A that follows.

1 2 3 4 5 6 7 8 9 10 13 12 13 16 15 18 17 18 19 22 21 24 23 24 25 26 27

This is no longer a permutation of the range, but if we stably sort the range by the values in that array, we can reconstruct the original array.

Code

27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ  Main link. No arguments.

27R                   Yield [1, ..., 27].
           ¦          Conditional application:
    “¿ÇÑÞæ‘             At indices 11, 14, 16, 20, and 22...
   +        2           add 2 to the corresponding value.
                      This yields the array A from the previous section.
             Ụ        Grade up; sort the indices of the result by its corresponding
                      values. This yields the array R from the previous section.
              +1487   Add 1487 to each integer in R.
                   Ọ  Unordinal; convert integers to characters.
\$\endgroup\$
0
15
\$\begingroup\$

PowerShell v2+, 58 bytes (UTF-16)

'אבגדהוזחטיכךלמםנןסעפףצץקרשת'

PowerShell Unicode is UTF-16 unless explicitly specified otherwise, and then it's a crapshoot anyway since it's all UTF-16 in the background.

This just puts the literal string on the pipeline and the default Write-Output at the end of program execution prints it to screen.

The shortest I could get the ASCII version is 63

-join([char[]]'ABCDEFGHIJLKMONQPRSUTWVXYZ['|%{[char](1423+$_)})

Which takes the ASCII value of the string ABC... and adds 1423 to each char to get the appropriate string.

\$\endgroup\$
2
  • 6
    \$\begingroup\$ Upvoted only because your ASCII version is clever. Must... support... clever... golfing! \$\endgroup\$
    – wizzwizz4
    Oct 21, 2016 at 18:48
  • 1
    \$\begingroup\$ It took me at least 5 minutes to realise that it wasn't the actual alphabet in the ASCII version. \$\endgroup\$ Dec 26, 2017 at 3:24
11
\$\begingroup\$

05AB1E, 36 29 26 25 23 bytes

Saved 2 bytes thanks to Adnan

Uses CP-1252 encoding.

1488•’ÉÇW–moû•5Bvy<+Dç?

Try it online!

Explanation

1488            # push 1488 (accumulator)
•’ÉÇW–moû•      # push 2235174277545950437
5B              # convert from base-5 to base-10 (122222222230330403230403222)
  v             # for each digit in above number
   y<           # decrease it by 1
     +          # add to accumulator
      Dç?       # print a copy of accumulator converted from code point
\$\endgroup\$
2
  • \$\begingroup\$ Interpreting the big number as a base 5 number saves two bytes: 1488•’ÉÇW–moû•5Bvy<+Dç?. \$\endgroup\$
    – Adnan
    Oct 21, 2016 at 18:28
  • \$\begingroup\$ @Adnan: Ah of course. Great thinking! \$\endgroup\$
    – Emigna
    Oct 21, 2016 at 18:29
9
\$\begingroup\$

Brain-Flak, 172 bytes

This answer is based largely one DJMcMayhem's solution here so I recomend you check it out.

Like DJMcMayhem's solution this uses the -rA flag to reverse output and print to unicode.

(((((()()()()()){})))<(((({}{}{}()){({}[()])}{})){}{})>){({}[()]<(({})())>)}{}(((((()()())((((((((({}(((({}())[()])()())()())[()]))[()])()())())()())[()]))[()])()())())())())

Try it online!

Explanation

I made this answer by running a bunch of micro-optimizations over the original solution provided by DJMcMayhem. These optimizations while saving bytes, make the code unreadable and the algorithm obtuse. I, to be honest, do not really understand how or what my code does.

Perhaps someday I will understand how this works...

\$\endgroup\$
6
\$\begingroup\$

Python 3, 50 bytes

#coding:cp862
print('אבגדהוזחטיכךלמםנןסעפףצץקרשת')

The file must be created using the CP862 encoding or by reversing the following hexdump.

0000000: 23 63 6f 64 69 6e 67 3a 63 70 38 36 32 0a 70 72  #coding:cp862.pr
0000010: 69 6e 74 28 27 80 81 82 83 84 85 86 87 88 89 8b  int('...........
0000020: 8a 8c 8e 8d 90 8f 91 92 94 93 96 95 97 98 99 9a  ................
0000030: 27 29                                            ')

This could probably be ported to Python 2 (thus saving two bytes), but I lack the proper locale to test it. Python 3 dutifully prints an UTF-8 encoded version (or whatever is appropriate for the current locale) of the alphabet.

Verification

$ base64 > hebrew.py -d <<< I2NvZGluZzpjcDg2MgpwcmludCgngIGCg4SFhoeIiYuKjI6NkI+RkpSTlpWXmJmaJyk=
$ wc -c hebrew.py
50 hebrew.py
$ echo $LANG
en_US.UTF-8
$ python3 hebrew.py
אבגדהוזחטיכךלמםנןסעפףצץקרשת
\$\endgroup\$
0
5
\$\begingroup\$

CJam, 23 bytes

27,"%(*.0"{i_)e\}/'אf+

Try it online!

How it works

27,                     Push [0 ... 26].
   "%(*.0"              Push that string. Its code points are [37 40 42 46 48],
                        which are [10 13 15 19 21] modulo the length of the string.
          {     }/      For each character:
           i              Compute its code point.
            _)            Push an incremented copy.
              e\          Swap the integers of [0 ... 26] at those indices.
                  'אf+  Add all resulting integers to the first character of the
                        Hebrew alphabet.
\$\endgroup\$
5
\$\begingroup\$

///, 27 bytes

ABCDEFGHIQSRTVUXWYbdcfeghiq

Try it online!

Output is encoded in CP424.

To verify it yourself:

$ echo ABCDEFGHIQSRTVUXWYbdcfeghiq | ./slashes.pl | python3 -c 'print(bytes(input(), "utf-8").decode("cp424"))' | base64
15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeqCg==
\$\endgroup\$
3
  • \$\begingroup\$ What kind of code is this? I think it needs to be converted to UTF-8 for viewing purposes anyways. Not that it is necessarily invalid :P have a +1 \$\endgroup\$ Oct 24, 2016 at 16:18
  • \$\begingroup\$ @EriktheGolfer There is no need to convert it to UTF-8. That is not a requirement anywhere in the challenge. \$\endgroup\$
    – user45941
    Oct 24, 2016 at 18:50
  • \$\begingroup\$ I think you might attract downvotes then. Please note that, in your place, I would have included the UTF-8 version and a hexdump of the original... \$\endgroup\$ Oct 25, 2016 at 10:36
5
\$\begingroup\$

JavaScript (ES6), 59 bytes

_=>"אבגדהוזחטיכךלמםנןסעפףצץקרשת"

Best I could do in ASCII was 80 79 78 bytes:

_=>String.fromCharCode(...[...0x377babbcf7f.toString(3)].map(c=>++n-c,n=1488))

If a character array is acceptable, 75 bytes:

_=>[...0x377babbcf7f.toString(3)].map(c=>String.fromCharCode(++n-c),n=1488)

Edit: Saved some bytes thanks to @IsmaelMiguel. Saved another byte thanks to @ETHproductions. If you use Firefox 30-57 then you can save another 2 bytes thanks to @ETHproductions using generator or array comprehensions:

_=>String.fromCharCode(...(for(c of 0x377babbcf7f.toString(3,n=1488))++n-c))
_=>[for(c of 0x377babbcf7f.toString(3,n=1488))String.fromCharCode(++n-c)]
\$\endgroup\$
6
  • \$\begingroup\$ You can save a byte on your ASCII alternative by using 0x377BABBCF7F.toString(3). Combinig this with .map(), you can do _=>0x377BABBCF7F.toString(3,n=1488).split``.map(_=>String.fromCharCode(++n-_)) for 78 bytes. It returns an array of characters. \$\endgroup\$ Oct 21, 2016 at 21:41
  • \$\begingroup\$ @IsmaelMiguel Nice catch on the .. but we don't use split around here. \$\endgroup\$
    – Neil
    Oct 21, 2016 at 23:42
  • \$\begingroup\$ Nice. You can modify the char-array version slightly to get _=>String.fromCharCode(...[...0x377babbcf7f.toString(3)].map(c=>++n-c,n=1488)), 1 byte shorter than the current 79 bytes. \$\endgroup\$ Oct 22, 2016 at 0:01
  • \$\begingroup\$ @ETHproductions Bah, I had played around with String.fromCharCode(...) and had managed to convince myself that it would always be longer. In fact it saves 4 bytes on my base 2 solution (which is still 84 bytes because it takes more bytes to decode). \$\endgroup\$
    – Neil
    Oct 22, 2016 at 0:16
  • \$\begingroup\$ If you're willing to use array comprehensions, you can get 2 bytes off of each; string: _=>String.fromCharCode(...[for(c of 0x377babbcf7f.toString(3,n=1488))++n-c]), char-array: _=>[for(c of 0x377babbcf7f.toString(3,n=1488))String.fromCharCode(++n-c)) \$\endgroup\$ Oct 22, 2016 at 0:59
4
\$\begingroup\$

Brain-Flak, 186 bytes

(((((((((((((((((((((((((((((((((()()()()()){})){}{}()){({}[()])}{})){}{})())())())())())())())())())()())[()])()())()())[()])()()())[()])()())())()())[()])()()())[()])()())())())())

This code is 182 bytes long, and I added 4 bytes for two command line flags: -r and -u

Try it online!

Many thanks to @Neil for this awesome integer metagolfer that created this sweet way of pushing 1488 (the code point of the first character)

(((((((()()()()()){})){}{}()){({}[()])}{})){}{})

Explanation:

Pushing large number in brain-flak is relatively difficult. However, since the act of pushing a number also evaluates to that number, we can push several numbers at the same time for massive byte savings. Here is a more concrete example. The innermost part (that I wrote above) in psuedo code is

push(1488)

This expression evaluates to 1488, so we wrap the entire thing in another push statement:

push(push(1488) + 1)

This pushes 1488 and 1489, as well as evaluating to 1489. So we wrap this:

push(push(push(1488) + 1) + 1)

which pushes 1488, 1489, and 1490, as well as evaluating to 1490. Repeat this step for each number we need to push.

However, since the increments aren't always 1, it's a little bit more complicated than that. Here is a more readable version:

(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
#Push 1488
(((((((()()()()()){})){}{}()){({}[()])}{})){}{})
())     # + 1
())
())
())
())
())
())
())
())
()())   # + 2
[()])   # - 1
()())   # + 2
()())
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
()())   # + 2
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
())
())
\$\endgroup\$
5
  • \$\begingroup\$ I thought it is +1 for -r because the - doesn't count \$\endgroup\$ Oct 21, 2016 at 17:47
  • 6
    \$\begingroup\$ @NoOneIsHere - doesn't count if it is already present from a different option (e.g. in perl -e). Brain-Flak doesn't have an existing option like that, so -, the option, and the space after all count toward the total. \$\endgroup\$
    – Riley
    Oct 21, 2016 at 18:01
  • \$\begingroup\$ Just a little improvement I made brain-flak.tryitonline.net/… \$\endgroup\$
    – Wheat Wizard
    Oct 21, 2016 at 20:35
  • \$\begingroup\$ @WheatWizard If I were to take that, then I wouldn't be able to write an explanation. It just looks like a jumbled mess of brackets to me. :P \$\endgroup\$
    – DJMcMayhem
    Oct 21, 2016 at 20:40
  • \$\begingroup\$ Its a very small change. I just moved the two instances of ()()() to the beginning and put them down and up. \$\endgroup\$
    – Wheat Wizard
    Oct 21, 2016 at 20:46
4
\$\begingroup\$

///, 54 bytes

אבגדהוזחטיכךלמםנןסעפףצץקרשת

Try it online!

There can't be any version more golfed than this :(

\$\endgroup\$
3
\$\begingroup\$

05AB1E, 28*2-1=55 bytes

"אבגדהוזחטיכךלמםנןסעפףצץקרשת

Try it online!

-1 byte thanks to Emigna + 28 bytes thanks to DJMCMayhem ;).

\$\endgroup\$
4
  • 4
    \$\begingroup\$ I don't know what encoding 05AB1E uses, but I highly doubt those are one byte chars in whatever it is. \$\endgroup\$
    – DJMcMayhem
    Oct 21, 2016 at 17:30
  • \$\begingroup\$ @DJMcMayhem I think TIO has a bug, those characters don't exist in CP-1252. \$\endgroup\$ Oct 21, 2016 at 20:37
  • \$\begingroup\$ @EriktheGolfer Most likely it uses UTF-8 for convenience and then the 05AB1E interpreter does the necessary internal conversion. That's what I do for V (which uses latin1). \$\endgroup\$
    – DJMcMayhem
    Oct 21, 2016 at 20:39
  • \$\begingroup\$ @DJMcMayhem Here it is shown as UTF-8 I think, but it also supports CP-1252, which you can use to make your byte count lower. This is not pure CP-1252, though, so it must be run with UTF-8 strings. \$\endgroup\$ Oct 21, 2016 at 20:41
2
\$\begingroup\$

Scala/Groovy/Python 3, 9 ascii-chars + 27 2-byte chars = 63 bytes

print("אבגדהוזחטיכךלמםנןסעפףצץקרשת")

assuming UTF-8

Scala, 59 bytes

print("ABCDEFGHIJLKMONQPRSUTWVXYZ["map(x=>(x+1423).toChar))

x+1423 is the same as x-'A'+1488

\$\endgroup\$
4
  • \$\begingroup\$ Polygot, it works in Groovy too; also, see my answer, bytecount is off. \$\endgroup\$ Oct 21, 2016 at 19:39
  • 1
    \$\begingroup\$ also in python 3 (also python 2 but then the parenthesis aren't necessary) \$\endgroup\$
    – user49822
    Oct 21, 2016 at 19:46
  • 1
    \$\begingroup\$ @caruscomputing I'd be wary of editing another user's byte count because you assume a certain encoding. Are you sure Scala can or can only handle UTF-8? Also, the Hebrew alphabet has 27 letters, so 61 is wrong one way or another. \$\endgroup\$
    – Dennis
    Oct 21, 2016 at 20:11
  • \$\begingroup\$ The first option also works on PHP. \$\endgroup\$ Oct 21, 2016 at 22:04
2
\$\begingroup\$

APL (Dyalog), 35 bytes

d←⍳27
d[⎕A⍳'KNPTV']+←2
⎕UCS 1487+⍋d

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ you can encode 11 14 16 20 22 as ⎕A⍳'KNPTV' \$\endgroup\$
    – ngn
    Dec 27, 2017 at 11:16
1
\$\begingroup\$

C#6+, 76 86 82 bytes

void f()=>Console.Write("אבגדהוזחטיכךלמםנןסעפףצץקרשת");

First attempt at Golfing. Am I doing this right?

EDIT: +6 bytes for forgetting to enclose in a function. Thanks @Kevin

C#5 and below version, 86 82 bytes

void f(){Console.Write("אבגדהוזחטיכךלמםנןסעפףצץקרשת");}
\$\endgroup\$
3
  • \$\begingroup\$ Actually, you should either print a function or a complete program. So void F(){Console.WriteLine("אבגדהוזחטיכךלמםנןסעפףצץקרשת");} would be valid, or ()=>{Console.WriteLine("אבגדהוזחטיכךלמםנןסעפףצץקרשת");} as well I think (not sure about this last one, though). Also, you can golf it by using .Write instead of .WriteLine. :) That being said, welcome to PPCG! You may find Tips for golfing in C# interesting to read through. Enjoy your stay. \$\endgroup\$ Oct 24, 2016 at 7:37
  • \$\begingroup\$ You know, you can use <s>your text</s> to strike some text instead of using strange characters. \$\endgroup\$ Oct 24, 2016 at 15:28
  • \$\begingroup\$ I wasn't aware about that. Anyway thanks @EriktheGolfer \$\endgroup\$ Oct 24, 2016 at 23:26
1
\$\begingroup\$

Fourier, 53 bytes

|+2a|X1488~i+10(ia^~i)^avaXXva+3avaX^aXva+3avaX^a^a^a

Uses functions again.

Try it FourIDE!

\$\endgroup\$
1
\$\begingroup\$

ArnoldC, 112 bytes

IT'S SHOWTIME
TALK TO THE HAND "אבגדהוזחטיכךלמםנןסעפףצץקרשת"
YOU HAVE BEEN TERMINATED
\$\endgroup\$
1
\$\begingroup\$

Keg, 34 bytes

Inspired by a Powershell solution.

ZYXVWTUSRPQNOMKLJIHGFEDCBA(֏+")(,

TIO

\$\endgroup\$
1
  • \$\begingroup\$ you're missing one char ("ת") at the end, the output is "אבגדהוזחטיכךלמםנןסעפףצץקרש". \$\endgroup\$
    – shahar_m
    May 2, 2020 at 2:51
0
\$\begingroup\$

BaCon, 57 bytes

  • In most BASICs, the question mark simply represents PRINT.

  • At first glance, the solution below looks like 30 bytes, but the Hebrew characters need 2 bytes of storage because of UTF-8. So there are 27 characters x 2 bytes + 1 byte for the '?' and 2 bytes for the double quotes = 57 bytes.

Solution:

?"אבגדהוזחטיכךלמםנןסעפףצץקרשת"
\$\endgroup\$
1
  • \$\begingroup\$ Try GW-BASIC with a CP862 VGA BIOS for 30. (Same text) \$\endgroup\$
    – Joshua
    Oct 21, 2016 at 21:48
0
\$\begingroup\$

s-lang, 59 bytes

Really simple answer...

t[][אבגדהוזחטיכךלמםנןסעפףצץקרשת]
  • t - replace function (replaces "nothing" in the input with the alphabet...)

Try it here

\$\endgroup\$
0
\$\begingroup\$

zsh, 25 21 bytes

echo ${(j..):-{ת..א}}

My browser is messing it up: the ת should be the first letter, then the א. If you paste somewhere else, though, it should work. The old version:

for i in {ת..א};printf $i
\$\endgroup\$
9
  • \$\begingroup\$ Invalid, because final letters and normal letters are reversed in Unicode \$\endgroup\$ Oct 22, 2016 at 18:58
  • \$\begingroup\$ Also, it's actually 27 bytes \$\endgroup\$ Oct 22, 2016 at 18:59
  • \$\begingroup\$ Oh and the range should actually be aleph first and tav last. If the string is reversed in the question, it's because Hebrew is an RTL language \$\endgroup\$ Oct 22, 2016 at 19:04
  • \$\begingroup\$ @TùxCräftîñg in my terminal, it displays correctly only with taf first an aleph last. What do you mean "final letters and normal letters are reversed in Unicode"? \$\endgroup\$
    – Moonchild
    Oct 22, 2016 at 19:14
  • \$\begingroup\$ In the text in the question, there is כך for example (normal kaf first, final kaf second), but in Unicode, final letters are before normal letters (ךכ), so the printed text in invalid. And if it display with tav first, it's because Hebrew is a RTL language, so the first character is displayed rightmost \$\endgroup\$ Oct 22, 2016 at 19:26
0
\$\begingroup\$

Java 7, 85 bytes

void c(){System.out.print("אבגדהוזחטיכךלמםנןסעפףצץקרשת");}

I'm not even gonna bother posting test code or a 'Try it here' like I usually do..

\$\endgroup\$
0
\$\begingroup\$

Perl 6 (74)

(map (*+1488).chr,[\+] '122222222230330403230403222'.comb >>->>1.join.say
\$\endgroup\$
0
\$\begingroup\$

Ruby, 49 bytes

-11.upto(15){|r|$><<(""<<r+1499-2601[r]+5202[r])}

Try it online!

\$\endgroup\$
0
\$\begingroup\$

Haskell, 23 bytes

main=putStr['א'..'ת']

Try it online!

This works in TIO's version of Haskell

\$\endgroup\$
0
\$\begingroup\$

C, 49 bytes

f(i){for(i=0x5d0;i<=0x5ea;i++)wprintf(L"%lc",i);}

Some users may need to call setlocale before using this but it worked fine for me.

\$\endgroup\$
1
  • \$\begingroup\$ Suggest for(i=1488;putwchar(i++)<1514;); instead of for(i=0x5d0;i<=0x5ea;i++)wprintf(L"%lc",i); \$\endgroup\$
    – ceilingcat
    May 10, 2019 at 1:04
0
\$\begingroup\$

Clean, 62 bytes

Start="אבגדהוזחטיכךלמםנןסעפףצץקרשת"

Try it online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.