答:
Perl, <s>120</s> <s>119</s> <s>113</s> <s>107</s> <s>104</s> 102 bytes

Includes +6 for -0pXi

Run with the hexagon on STDIN (padded with spaces so all lines have the same length) and the number of rotations after -i.

```<code>perl -0pXi1 rotagon.pl
  a b c
 d d e e
f f o g g
 h h i i
  j k l
^D
</code>```

rotagon.pl

```<code>s!(.)!$X=(3*($w=y/
//*2)/4+($-="@-"/$w)-"@+"%$w)/2*--$w+2*$--.25;/^\C{$X}(.)/;$1!eg while$^I--%6
</code>```

Finally got the rotation matrix to be shorter than the old double loop

Title: HexaGolf: Rotatagons

Body:
See also: Wordagons

Challenge

Given a hexagon and a number n as input, output the same hexagon rotated n times.

Hexagon

The hexagon will be a string like so:

```<code>  a b c
 d d e e
f f o g g
 h h i i
  j k l
</code>```

The hexagon will always be regular and will only ever contain the printable ASCII characters:

```<code> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
</code>```

Rotation

To find how much to rotate the hexagon by, multiply n by 60 degrees to get the angle of rotation. For example, using the above hexagon, if n is 2, we multiply that by 60 to get 120 degrees. Then, we rotate the hexagon by 120 degrees:

```<code>  j h f
 k h f d
l i o d a
 i g e b
  g e c
</code>```

Note that each side has moved two sides clockwise.

If n is positive, you should rotate the hexagon clockwise. If n is negative, you should rotate the hexagon anticlockwise.

n will always be an integer in the range -6 to 6 inclusive.

Examples

Input:

```<code>  . u .
 .  |  .
l - + - r
 .  |  .
  . d .
</code>```

n = 3

```<code>  . d .
 .  |  .
r - + - l
 .  |  .
  . u .
</code>```

Input:

```<code>  - - -
 /     \
<       >
 \     /
  - - -
</code>```

n = -1

Output:

```<code>  - \ >
 -     /
-       -
 /     -
  < \ -
</code>```

Input:

```<code>   h e x a
  g o n s a
 n d t r i a
n g l e s m a
 k e m e s a
  d l y m a
   d d e r
</code>```

n = 6

Output:

```<code>   h e x a
  g o n s a
 n d t r i a
n g l e s m a
 k e m e s a
  d l y m a
   d d e r
</code>```

Winning

The shortest program in bytes wins.

Body:
Perl, <s>120</s> <s>119</s> <s>113</s> <s>107</s> <s>104</s> 102 bytes

Includes +6 for -0pXi

Run with the hexagon on STDIN (padded with spaces so all lines have the same length) and the number of rotations after -i.

perl -0pXi1 rotagon.pl
  a b c
 d d e e
f f o g g
 h h i i
  j k l
^D

rotagon.pl

s!(.)!$X=(3*($w=y/
//*2)/4+($-="@-"/$w)-"@+"%$w)/2*--$w+2*$--.25;/^\C{$X}(.)/;$1!eg while$^I--%6

Finally got the rotation matrix to be shorter than the old double loop


问:
Faux Source Code
Output one random character for each character of source code (as illustrated below). The probability of each character is its frequency in the original source code. Thus the output will be fake source code resembling a quine.

Specification

Restrictions

Standard quine constrains apply. No empty programs or functions. Also no reading your own source.

Output

The number of characters output should be exactly the number of characters in the source code

Each output character should be randomly choosen

The probability of choosing any character is equal to (occurrences in source) / (length of source)

This means that even a unary solution needs to 'randomly' choose 1 with probability 1. Which is to say that the output can't be hard coded.

Winning

This is code golf, so fewest bytes wins

Example

```<code>Program           Frequency           Probability           Possible Output
-------           ---------           -----------           ---------------
 a@!@              a - 1               a - 25%               @@a@
                   ! - 1               ! - 25%
                   @ - 2               @ - 50%
</code>```

```<code>Program           Frequency           Probability           Possible Output
-------           ---------           -----------           ---------------
caBaDBcDaBDB       a - 3               a - 25%               aaaBBBBccDDD
                   B - 4               B - 33%
                   c - 2               c - 17%
                   D - 3               D - 25%
</code>```

答:
Python 3, <s>134</s> 132 bytes

I use every character in my source code within the string the correct number of times, then multiply the string by two to include itself. The program prints a random character from that string for each character in the code (the length is hard-coded.)

from random import*
for i in[0]*134:print(choice("""from random import*
for i in[0]*134:print(choice(""*""2""),end='')"""*2),end='')
```
<p><strong>Try it online</strong></p>
<p>I avoided backslashes like the plague. As soon as the code contains <code>\n</code> or <code>\"</code>, you have a problem, because the string doesn't contain backslashes yet, so you have to add those also, but in a separate string multiplied by a higher number, because it takes two backslashes to represent one (<code>\\</code>).</p>
<h3>Example output:</h3>
```i(tc*"3]i o''r=,,,h34t"r
ri"](fco t)niap)t "it2nc0o  npoi3'"nto(*4 i(ido' r*4f"oi]d rm ,i"eif)m"d
m emi
dfr n*p 3*(i""r1d"dr menc hio'
```

I gotta say, it reminds me of FlogScript.

ContentLicense: CC BY-SA 3.0

Title: Faux Source Code

Body:
Python 3, <s>134</s> 132 bytes

I use every character in my source code within the string the correct number of times, then multiply the string by two to include itself. The program prints a random character from that string for each character in the code (the length is hard-coded.)

from random import*
for i in[0]*134:print(choice("""from random import*
for i in[0]*134:print(choice(""*""2""),end='')"""*2),end='')

Try it online

I avoided backslashes like the plague. As soon as the code contains \n or \", you have a problem, because the string doesn't contain backslashes yet, so you have to add those also, but in a separate string multiplied by a higher number, because it takes two backslashes to represent one (\\).

Example output:

i(tc*"3]i o''r=,,,h34t"r
ri"](fco t)niap)t "it2nc0o  npoi3'"nto(*4 i(ido' r*4f"oi]d rm ,i"eif)m"d
m emi
dfr n*p 3*(i""r1d"dr menc hio'

I gotta say, it reminds me of FlogScript.


问:
Conjugate a Turkish verb

Input

verb, a string that matches the regular expression ([a-pr-vyzıöüçğş]*[aeıioöuü][bcçdfgğhj-nprsştvyz]+|([a-pr-vyzıöüçğş]*[aeıioöuü]){2})(mak|mek)

plural, a truthy or falsy value

person, an integer having value either 1, 2, or 3

tense, an integer having value either 1, 2, or 3

Output

The conjugated form of the Turkish verb verb, in personst/nd/rd person, plural if plural is TRUE and singular if it is not, in

If tense is 1, the simple present;

If tense is 2, the continuing present;

If tense is 3, the future.

Rules

Turkish verbs are conjugated in three elements, which are in order:

The stem, formed by removing mak or mek from the end of the infinitive;

The sign of the tense, which is:

For the simple present:

-r if the stem ends in a vowel;

-ir according to vowel harmony rules (see below) if the stem contains more than one syllable (i.e. vowel), or is from one of the following irregular verbs: almak, bilmek, bulmak, durmak, gelmek, görmek, kalmak, olmak, ölmek, sanmak, vermek, varmak, vurmak;

-er according to vowel harmony rules if the stem contains one syllable and is not listed in the irregular verbs above.

For the continuing present, -iyor, where the i changes according to vowel harmony rules. Stems that end in a vowel drop this vowel before adding this suffix, whereupon the suffix harmonizes with the next-to-last vowel in the word (guaranteed to exist by the regular expression).

For the future:

-ecek according to vowel harmony rules if the stem ends in a consonant;

-yecek according to vowel harmony rules if the stem ends in a vowel.

The personal suffix to indicate the performer of the action, in all cases according to vowel harmony rules:

```<code>    |Singular|Plural|
|---|--------|------|
|1st|    -im |   -iz|
|2nd|   -sin |-siniz|
|3rd| (none) |  -ler|
</code>```

The final k of the future tense becomes ğ before -im and -iz, so for example (almak, TRUE, 1, 3) would yield alacağız.

Vowel harmony rules

Turkish vowels are divided into two groups: back (a ı o u) and front (e i ö ü) by where in the mouth they are pronounced. The suffixes of a word change vowels according to the vowels of the root.

All suffixes listed above that have i as a vowel instead use:

-ı if the last vowel before the suffix is ı or a (both these vowels are back and unrounded);

-i if the last vowel before the suffix is i or e (both these vowels are front and unrounded; note here Turkish's distinction between dotted and dotless I);

-u if the last vowel before the suffix is u or o (both these vowels are back and rounded); or

-ü if the last vowel before the suffix is ü or ö (both these vowels are front and rounded).

Take careful note of the present continuous suffix -iyor. The i harmonizes, but the o does not change. The personal suffixes will thus harmonize with the o.

All the suffixes listed above that have e as a vowel instead use:

-e if the last vowel before the suffix is a front vowel; or

-a if the last vowel before the suffix is a back vowel.

Irregular verbs

The verbs gitmek, tatmak, ditmek, gütmek, and etmek change the final t to a d before any endings that begin with a vowel (which includes all the endings in this challenge). Any verb that ends in -etmek likewise changes the t to a d, and appends -er for the simple present (though this is not so for the other verbs).

Test cases

```<code>gütmek, FALSE, 1, 2 -> güdüyorum
almak, TRUE, 3, 3 -> alacaklar
boğmak, TRUE, 2, 1 -> boğarsınız
ölmek, FALSE, 3, 1 -> ölür
boyamak, TRUE, 1, 2 -> boyuyoruz
affetmek, FALSE, 2, 1 -> affedersin
söylemek, TRUE, 3, 1 -> söylerler
söylemek, FALSE, 3, 2 -> söylüyor
söylemek, FALSE, 1, 3 -> söyleyeceğim
</code>```

答:
Javascript (ES6), <s>466</s> <s>456</s> <s>451</s> 446 bytes

```<code>(v,p,w,t)=>(R=g=>g.exec(s),T=r=>s=s.slice(0,-1)+r,Z=s=>s.replace(/\d/g,c=>l=['ıuiü'[(n='aıoueiöü'.search(l))>>1],'ae'[n>>2]][c]),(s=v.slice(k=l=0,-3)).replace(/[aıoueiöü]/g,c=>(L=l,l=c,k++)),(R(/^(gi|ta|di|gü)t$/)||(R(/et$/)&&(k=1)))&&T`d`,((E=R(/[aıoueiöü]$/))&&t==2?(l=L,T``):s)+Z([(E?'':k<2&!R(/^((k?a|bi|bu|ge|o|ö)l)|dur|gör|san|v[aeu]r$/))+'r','0yor',(E?'y1c1':'1c1')+'ğkk'[--w]][t-1])+Z('0m|0z|s0n|s0n0z||l1r'.split`|`[w+w+p],t-2||(l='o')))
</code>```

Ungofled and commented

```<code>// Parameters:
//   - 'v' = verb
//   - 'p' = plural flag
//   - 'w' = person
//   - 't' = tense
(v, p, w, t) => (
  // R() - Helper function to execute a regular expression on the stem.
  R = g => g.exec(s),

  // T() - Helper function to replace the last character of the stem with 'r'.
  T = r => s = s.slice(0, -1) + r,

  // Z() - Function that applies vowel harmony to the string 's', assuming
  //       '0' = 'i' and '1' = 'e' and using the last encountered vowel 'l'.
  Z = s => s.replace(
    /\d/g,
    c => l = [
      'ıuiü' [(n = 'aıoueiöü'.search(l)) >> 1],
      'ae' [n >> 2]
    ][c]
  ),

  // Computes:
  //   - 's' = stem
  //   - 'k' = number of vowels in stem
  //   - 'l' = last vowel in stem
  //   - 'L' = penultimate vowel in stem
  (s = v.slice(k = l = 0, -3)).replace(/[aıoueiöü]/g, c => (L = l, l = c, k++)),

  // Applies ending 't' => 'd' for irregular verbs and those ending in -et(mek).
  (R(/^(gi|ta|di|gü)t$/) || (R(/et$/) && (k = 1))) && T `d`,

  // Computes 'E' = truthy value if the stem ends in a vowel.
  // If 'E' is truthy and the tense is the continuing present, drops this vowel.
  ((E = R(/[aıoueiöü]$/)) && t == 2 ? (l = L, T ``) : s) +

  // Appends sign of tense with vowel harmony.
  Z([
    // t = 1: simple present -> either '-er', '-ir' or '-r'
    (E ? '' : k < 2 & !R(/^((k?a|bi|bu|ge|o|ö)l)|dur|gör|san|v[aeu]r$/) + 'r',

    // t = 2: continuing present -> always '-iyor'
    '0yor',

    // t = 3: future -> either '-yecek', '-ecek', '-yeceğ' or '-eceğ'
    (E ? 'y1c1' : '1c1') + 'ğkk' [--w]
  ][t - 1]) +

  // Appends personal suffix with vowel harmony,
  // forcing last vowel to 'o' for continuing present.
  Z(
    '0m|0z|s0n|s0n0z||l1r'.split `|` [w + w + p],
    t - 2 || (l = 'o')
  )
)
</code>```

Test cases

let f =
(v,p,w,t)=>(R=g=>g.exec(s),T=r=>s=s.slice(0,-1)+r,Z=s=>s.replace(/\d/g,c=>l=['ıuiü'[(n='aıoueiöü'.search(l))>>1],'ae'[n>>2]][c]),(s=v.slice(k=l=0,-3)).replace(/[aıoueiöü]/g,c=>(L=l,l=c,k++)),(R(/^(gi|ta|di|gü)t$/)||(R(/et$/)&&(k=1)))&&T`d`,((E=R(/[aıoueiöü]$/))&&t==2?(l=L,T``):s)+Z([(E?'':k<2&!R(/^((k?a|bi|bu|ge|o|ö)l)|dur|gör|san|v[aeu]r$/))+'r','0yor',(E?'y1c1':'1c1')+'ğkk'[--w]][t-1])+Z('0m|0z|s0n|s0n0z||l1r'.split`|`[w+w+p],t-2||(l='o')))

console.log(f("gütmek", false, 1, 2));    // -> güdüyorum
console.log(f("almak", true, 3, 3));      // -> alacaklar
console.log(f("boğmak", true, 2, 1));     // -> boğarsınız
console.log(f("ölmek", false, 3, 1));     // -> ölür
console.log(f("boyamak", true, 1, 2));    // -> boyuyoruz
console.log(f("affetmek", false, 2, 1));  // -> affedersin
console.log(f("söylemek", true, 3, 1));   // -> söylerler
console.log(f("söylemek", false, 3, 2));  // -> söylüyor
console.log(f("söylemek", false, 1, 3));  // -> söyleyeceğim```

Title: Conjugate a Turkish verb

Body:
Javascript (ES6), <s>466</s> <s>456</s> <s>451</s> 446 bytes

(v,p,w,t)=>(R=g=>g.exec(s),T=r=>s=s.slice(0,-1)+r,Z=s=>s.replace(/\d/g,c=>l=['ıuiü'[(n='aıoueiöü'.search(l))>>1],'ae'[n>>2]][c]),(s=v.slice(k=l=0,-3)).replace(/[aıoueiöü]/g,c=>(L=l,l=c,k++)),(R(/^(gi|ta|di|gü)t$/)||(R(/et$/)&&(k=1)))&&T`d`,((E=R(/[aıoueiöü]$/))&&t==2?(l=L,T``):s)+Z([(E?'':k<2&!R(/^((k?a|bi|bu|ge|o|ö)l)|dur|gör|san|v[aeu]r$/))+'r','0yor',(E?'y1c1':'1c1')+'ğkk'[--w]][t-1])+Z('0m|0z|s0n|s0n0z||l1r'.split`|`[w+w+p],t-2||(l='o')))

Ungofled and commented

// Parameters:
//   - 'v' = verb
//   - 'p' = plural flag
//   - 'w' = person
//   - 't' = tense
(v, p, w, t) => (
  // R() - Helper function to execute a regular expression on the stem.
  R = g => g.exec(s),

  // T() - Helper function to replace the last character of the stem with 'r'.
  T = r => s = s.slice(0, -1) + r,

  // Z() - Function that applies vowel harmony to the string 's', assuming
  //       '0' = 'i' and '1' = 'e' and using the last encountered vowel 'l'.
  Z = s => s.replace(
    /\d/g,
    c => l = [
      'ıuiü' [(n = 'aıoueiöü'.search(l)) >> 1],
      'ae' [n >> 2]
    ][c]
  ),

  // Computes:
  //   - 's' = stem
  //   - 'k' = number of vowels in stem
  //   - 'l' = last vowel in stem
  //   - 'L' = penultimate vowel in stem
  (s = v.slice(k = l = 0, -3)).replace(/[aıoueiöü]/g, c => (L = l, l = c, k++)),

  // Applies ending 't' => 'd' for irregular verbs and those ending in -et(mek).
  (R(/^(gi|ta|di|gü)t$/) || (R(/et$/) && (k = 1))) && T `d`,

  // Computes 'E' = truthy value if the stem ends in a vowel.
  // If 'E' is truthy and the tense is the continuing present, drops this vowel.
  ((E = R(/[aıoueiöü]$/)) && t == 2 ? (l = L, T ``) : s) +

  // Appends sign of tense with vowel harmony.
  Z([
    // t = 1: simple present -> either '-er', '-ir' or '-r'
    (E ? '' : k < 2 & !R(/^((k?a|bi|bu|ge|o|ö)l)|dur|gör|san|v[aeu]r$/) + 'r',

    // t = 2: continuing present -> always '-iyor'
    '0yor',

    // t = 3: future -> either '-yecek', '-ecek', '-yeceğ' or '-eceğ'
    (E ? 'y1c1' : '1c1') + 'ğkk' [--w]
  ][t - 1]) +

  // Appends personal suffix with vowel harmony,
  // forcing last vowel to 'o' for continuing present.
  Z(
    '0m|0z|s0n|s0n0z||l1r'.split `|` [w + w + p],
    t - 2 || (l = 'o')
  )
)

Test cases

let f =
(v,p,w,t)=>(R=g=>g.exec(s),T=r=>s=s.slice(0,-1)+r,Z=s=>s.replace(/\d/g,c=>l=['ıuiü'[(n='aıoueiöü'.search(l))>>1],'ae'[n>>2]][c]),(s=v.slice(k=l=0,-3)).replace(/[aıoueiöü]/g,c=>(L=l,l=c,k++)),(R(/^(gi|ta|di|gü)t$/)||(R(/et$/)&&(k=1)))&&T`d`,((E=R(/[aıoueiöü]$/))&&t==2?(l=L,T``):s)+Z([(E?'':k<2&!R(/^((k?a|bi|bu|ge|o|ö)l)|dur|gör|san|v[aeu]r$/))+'r','0yor',(E?'y1c1':'1c1')+'ğkk'[--w]][t-1])+Z('0m|0z|s0n|s0n0z||l1r'.split`|`[w+w+p],t-2||(l='o')))

console.log(f("gütmek", false, 1, 2));    // -> güdüyorum
console.log(f("almak", true, 3, 3));      // -> alacaklar
console.log(f("boğmak", true, 2, 1));     // -> boğarsınız
console.log(f("ölmek", false, 3, 1));     // -> ölür
console.log(f("boyamak", true, 1, 2));    // -> boyuyoruz
console.log(f("affetmek", false, 2, 1));  // -> affedersin
console.log(f("söylemek", true, 3, 1));   // -> söylerler
console.log(f("söylemek", false, 3, 2));  // -> söylüyor
console.log(f("söylemek", false, 1, 3));  // -> söyleyeceğim


问:
Tips for golfing in <all languages>
The aim of this post is to gather all the golfing tips that can be easily applied to <all languages> rather than a specific one.

Only post answers that its logic can be applied to the majority of the languages

Please, one tip per answer

答:
Understand what other people did

In addition to being fun, if you examine other people's code, you can sometimes discover a good algorithm that you didn't think about, or a trick (sometimes an obvious one) that you overlook.

Sometimes there is an existing answer that you can translate to another language, and benefit from the other language's goodies.

Title: Tips for golfing in <all languages>


问:
Print every character your program doesn't have
Your task is to build a program (using only printable ASCII characters and/or tabs and newlines) that prints out exactly the characters in the printable ASCII space (0x20 to 0x7e) that don't appear in your program's source code (in any order, however many times you want).

The shortest code to do this in any language wins.

答:
ISOLADOS, 7369 bytes (non-competing)

```<code>ISOLAADOOS ISOLAAAAAAADOS ISOLAADOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAA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

Body:
ISOLADOS, 7369 bytes (non-competing)

ISOLAADOOS ISOLAAAAAAADOS ISOLAADOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAA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OLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS ISOLAADOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAAADOS


问:
UNIX Uniq Uknow?

Challenge

You must write a program which takes a string and a flag as input and performs one of the following functions.

Input

If your language does not support command line arguments, you may take the arguments as input via STDIN.

The flag will be two characters: a dash and an ASCII character such as -d or -c.

Functions

The following is the list of functions which you must implement in your program. The title of each is the flag which corresponds to the function.

Counting: -c

This counts the number of duplicate lines in the input file. For example, if the input is:

```<code>aa
aa
bb
bb
bb
xx
</code>```

The output will be:

```<code>2 aa
3 bb
1 xx
</code>```

Because there are two lines of aa, three lines of bb, and one line of xx. The output should be separated by newlines.

Duplication: -d

This shows which lines are duplicates. For example, using the above example string (aa\naa\nbb\nbb\nbb\nxx), the output would be:

```<code>aa
bb
</code>```

Because these are lines which have been duplicated. You should only output each line once.

Duplication: -D

This is almost the same as -d except it outputs each line the number of times that it occurs in the input file. For example, using the example string the output will be:

```<code>aa
aa
bb
bb
bb
</code>```

Because aa occurs twice and bb occurs three times.

Unique: -u

Similar to above except it only prints unique lines. For example, using the example file, the output will be:

```<code>xx
</code>```

Because xx is the only unique line. Also, due to xx being unique, you will only ever have to output this once.

Example

Note that although the input string will not always be sorted, the output must be sorted alphabetically. For example, for the following input:

```<code>hello world
apple pie
zebra
dog
hello world
apple pie
apple pie
apple pie
</code>```

The output for each of the flags would be:

-c

```<code>4 apple pie
1 dog
2 hello world
1 zebra
</code>```

-d

```<code>apple pie
hello world
</code>```

-D

```<code>apple pie
apple pie
apple pie
apple pie
hello world
hello world
</code>```

-u

```<code>dog
zebra
</code>```

Rules

Your programs must not use the UNIX program uniq as, frankly, that is plain cheating.

All output should be to STDOUT.

The file will only ever contain lowercase, alphabetical characters, newlines and spaces:

```<code>2 aa
3 bb
1 xx
</code>```0

The output should be sorted alphabetically.

In case there is any confusion, programs written on any operating system can enter. The challenge is not limited to UNIX.

As per PPCG standard, functions and anonymous functions are allowed, taking input via their arguments and outputting via a returned string.

Winning

As this is code-golf, the shortest code in bytes wins.

答:
Groovy (185 Bytes)

Golf'd:

```<code>x={m,l->u=[];u.addAll(l);u.unique();c=u.collect{v->[v,l.count{it==v}]};D=c.collect{a,b->if (b>1){(1..b).collect{a}}};D.remove(null);m=='d'?D.collect{it.unique()}:['D':D,'c':c,'u':u][m]}
</code>```

https://groovyconsole.appspot.com/edit/5173563388592128

Ungolf'd (Kinda):

```<code>x = {
    m,l->
        u=[];
        u.addAll(l);
        u.unique();
        c = u.collect {
            v->
                [v, l.count {it==v}]
        }
        D = c.collect {
            a,b->
                if (b>1) {
                    (1..b).collect{a}
                }
        }
        D.remove(null)
        m == 'd' ? D.collect{it.unique()} : ['D':D,'c':c,'u':u][m]
}
</code>```

Output

u Results aa bb xx

c Results [aa, 3] [bb, 2] [xx, 1]

D Results [aa, aa, aa] [bb, bb]

d Results [aa] [bb]

Title: UNIX Uniq Uknow?

Body:
Groovy (185 Bytes)

Golf'd:

x={m,l->u=[];u.addAll(l);u.unique();c=u.collect{v->[v,l.count{it==v}]};D=c.collect{a,b->if (b>1){(1..b).collect{a}}};D.remove(null);m=='d'?D.collect{it.unique()}:['D':D,'c':c,'u':u][m]}

https://groovyconsole.appspot.com/edit/5173563388592128

Ungolf'd (Kinda):

x = {
    m,l->
        u=[];
        u.addAll(l);
        u.unique();
        c = u.collect {
            v->
                [v, l.count {it==v}]
        }
        D = c.collect {
            a,b->
                if (b>1) {
                    (1..b).collect{a}
                }
        }
        D.remove(null)
        m == 'd' ? D.collect{it.unique()} : ['D':D,'c':c,'u':u][m]
}

Output

u Results aa bb xx

c Results [aa, 3] [bb, 2] [xx, 1]

D Results [aa, aa, aa] [bb, bb]

d Results [aa] [bb]


问:
Output "Lorem ipsum" with minimal number of characters
I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.

How bad can it be?

In this challenge, you should output the following Lorem Ipsum text, taken from Wikipedia:

```<code>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</code>```

Please specify the number of characters (not bytes) in your code. Code with the minimal number of characters wins.

Your code should only contain valid Unicode characters, as described here, that is:

Code points up to U+10FFFF

No surrogates (the range D800–DBFF is forbidden)

No characters FFFE and FFFF

No null characters (code 0)

If your code cannot be displayed, provide a version with offending characters redacted, and a hexdump.

Some notes:

The output must be one long line (445 characters). If your system cannot do that (e.g. you're printing it on paper), output a closest approximation. Trailing linebreaks don't matter.

Built-in functions that generate Lorem Ipsum text are not allowed

Please specify a valid text encoding for your code, if relevant

答:
PHP ,247 Characters

combination of the 2 previous versions

```<code>echo gzuncompress(base64_decode(mb_convert_encoding("敊眱歍䙸兺䕉剆癚䅪礯極南慷潧楏㡷䥷汚䅯⽌䐸灐扫䱁獶猫扅煄橨啎硡灎䱈噑䔷⭂牓㥨䘴㡊䭪瀰獦夷灇漲氵剣杇楳婧啵扥卹摴慩䩢潪䡊圫啨㝩氷卧ぢご煏潪㙍䍮儷焲ㅅ扔⽘桭卥㉇别桃琫啺䍵公欹塊ㅔ煩噭灳氯䥥ぱ堷ぱ⭫橨祇啂灶㙣浵䅈湋䐷硴卑潘㙉砰捭塖橩汪祲昰䥪佄㔸晔慯眸䨲歮欰䱗䕲䑗⭫㡯䅷塏畃猵⭪慅兔佌流晥塹穄䩔扇婇䑍䩊硺䡅䵌⭤㝉䙇佡䙵浢㑩慖剺湱潊ぢ摰㝋卩楹婏㕵猷灴ぁ慫楗倹捙ㄲ⽁䍧塋啊","UTF-16")));
</code>```

PHP, 261 Characters

```<code>echo mb_convert_encoding("䱯牥洠楰獵洠摯汯爠獩琠慭整Ⱐ捯湳散瑥瑵爠慤楰楳捩湧汩琬⁳敤漠敩畳浯搠瑥浰潲湣楤楤畮琠畴慢潲攠整潬潲攠浡杮愠慬楱畡⸠啴湩洠慤楮業⁶敮楡洬ⁱ畩猠湯獴牵搠數敲捩瑡瑩潮⁵汬慭捯慢潲楳楳椠畴汩煵楰砠敡潭浯摯潮獥煵慴⸠䑵楳畴攠楲畲攠摯汯爠楮⁲数牥桥湤敲楴渠癯汵灴慴攠癥汩琠敳獥楬汵洠摯汯牥甠晵杩慴畬污⁰慲楡瑵爮⁅硣数瑥畲⁳楮琠潣捡散慴異楤慴慴潮⁰牯楤敮琬⁳畮琠楮畬灡ⁱ畩晦楣楡敳敲畮琠浯汬楴湩洠楤獴慢潲畭.","UTF-16");
</code>```

Encoding $s contains the string

```<code>foreach(str_split(bin2hex($s),4)as $c)eval('echo"\u{'.$c.'}";');
</code>```

Old Version PHP , 386 Bytes|Characters

```<code>echo gzinflate(base64_decode("NZDBcUMxCERb2QI8v4rklmsKIIjvMCMJWQKPyw/KT25CwLL7PmxKg44VDcWqTSx1UBO/ga0vYRePCSo6dLH2O6RqNpeUXIBorGYFLm3ksnbWoiW6IxyVvlIe4pe0oNG9E6jqI+jAp0O6ttRG0/14ZknthkfoQrflMwrkJZPVydU6olZqbJfyHtKl+9KvpI4chlAab+nJrgB5yg+8bUkKF+iMdHJl1Y4pY8q39CIzg+fH02qMPCdpJ5NC1hKw1vpPKAMFzrgrOfo2hEEzi5gH3l8swyU2xmRgzCSccxxDC/neyBRjmhbpm+ImlUc56qCdG3aeykoosmTubrO6bdAGpIlj/XGNdvwA"));
</code>```

Body:
PHP ,247 Characters

combination of the 2 previous versions

echo gzuncompress(base64_decode(mb_convert_encoding("敊眱歍䙸兺䕉剆癚䅪礯極南慷潧楏㡷䥷汚䅯⽌䐸灐扫䱁獶猫扅煄橨啎硡灎䱈噑䔷⭂牓㥨䘴㡊䭪瀰獦夷灇漲氵剣杇楳婧啵扥卹摴慩䩢潪䡊圫啨㝩氷卧ぢご煏潪㙍䍮儷焲ㅅ扔⽘桭卥㉇别桃琫啺䍵公欹塊ㅔ煩噭灳氯䥥ぱ堷ぱ⭫橨祇啂灶㙣浵䅈湋䐷硴卑潘㙉砰捭塖橩汪祲昰䥪佄㔸晔慯眸䨲歮欰䱗䕲䑗⭫㡯䅷塏畃猵⭪慅兔佌流晥塹穄䩔扇婇䑍䩊硺䡅䵌⭤㝉䙇佡䙵浢㑩慖剺湱潊ぢ摰㝋卩楹婏㕵猷灴ぁ慫楗倹捙ㄲ⽁䍧塋啊","UTF-16")));

PHP, 261 Characters

echo mb_convert_encoding("䱯牥洠楰獵洠摯汯爠獩琠慭整Ⱐ捯湳散瑥瑵爠慤楰楳捩湧汩琬⁳敤漠敩畳浯搠瑥浰潲湣楤楤畮琠畴慢潲攠整潬潲攠浡杮愠慬楱畡⸠啴湩洠慤楮業⁶敮楡洬ⁱ畩猠湯獴牵搠數敲捩瑡瑩潮⁵汬慭捯慢潲楳楳椠畴汩煵楰砠敡潭浯摯潮獥煵慴⸠䑵楳畴攠楲畲攠摯汯爠楮⁲数牥桥湤敲楴渠癯汵灴慴攠癥汩琠敳獥楬汵洠摯汯牥甠晵杩慴畬污⁰慲楡瑵爮⁅硣数瑥畲⁳楮琠潣捡散慴異楤慴慴潮⁰牯楤敮琬⁳畮琠楮畬灡ⁱ畩晦楣楡敳敲畮琠浯汬楴湩洠楤獴慢潲畭.","UTF-16");

Encoding $s contains the string

foreach(str_split(bin2hex($s),4)as $c)eval('echo"\u{'.$c.'}";');

Old Version PHP , 386 Bytes|Characters

echo gzinflate(base64_decode("NZDBcUMxCERb2QI8v4rklmsKIIjvMCMJWQKPyw/KT25CwLL7PmxKg44VDcWqTSx1UBO/ga0vYRePCSo6dLH2O6RqNpeUXIBorGYFLm3ksnbWoiW6IxyVvlIe4pe0oNG9E6jqI+jAp0O6ttRG0/14ZknthkfoQrflMwrkJZPVydU6olZqbJfyHtKl+9KvpI4chlAab+nJrgB5yg+8bUkKF+iMdHJl1Y4pY8q39CIzg+fH02qMPCdpJ5NC1hKw1vpPKAMFzrgrOfo2hEEzi5gH3l8swyU2xmRgzCSccxxDC/neyBRjmhbpm+ImlUc56qCdG3aeykoosmTubrO6bdAGpIlj/XGNdvwA"));


问:
Emulate a 7-segment display

Task

The task is to display any of the 128 possible states of a
7-segment display.

Your program should accept a string of 7 characters ("bits") that are either 0 or 1.
First bit of input corresponds to segment A of the following illustration, the
second to B, etc (ignore dp):

How you represent the display is up to you -- a single Unicode or ASCII symbol,
ASCII art, grafically, or whatever you can come up with. However, each
input must have it's own distinct output. If you come up with something fancy I'm sure you can harvest upvotes by showing off some examples.

All 128 possible states of the display are:

Rules

Codegolf

As I said, any kind of output is allowed, but it would be nice if you specified it.

Input can be stdin or command line argument.

Examples

Input

```<code>1101101
</code>```

Output

As ASCII/Unicode:

```<code>2
</code>```

Different kinds of ASCII art (I'm not too good at this)

```<code> _   ╺┓  ╒╗   ---
 _|  ┏┛  ╔╝     |
|_   ┗╸  ╚╛   ---
              |
              ---
</code>```

答:
PHP 66 bytes

```<code><?for(;11>$i;)echo++$i&3?$argv[1][md5(¡æyÚ.$i)%8]?$i&1?~ƒ:_:~ß:~õ;
</code>```

A slight improvement using an md5 magic formula, but requires 3 additional binary bytes:

¡, æ, and Ú are characters 161, 230, and 218 respectively. It should work as is if copied directly, and saved as an ANSI format.

PHP 73 (70) bytes

```<code><?for($s=327638584;3<$s;)echo++$i&3?$argv[1][7&$s/=8]?$i&1?'|':_:' ':'
';
</code>```

If you'll allow me three binary characters, this can be reduced to 70 bytes:

```<code><?for($s=327638584;3<$s;)echo++$i&3?$argv[1][7&$s/=8]?$i&1?~ƒ:_:~ß:~õ;
</code>```

where ƒ, ß, and õ are characters 131, 223, and 245 respectively.

Receives input as a command line argument. Sample usage:

```<code>$ php seven-seg.php 1101101
 _
 _|
|_

$ php seven-seg.php 0111011

|_|
 _|
</code>```

Title: Emulate a 7-segment display

Body:
PHP 66 bytes

<?for(;11>$i;)echo++$i&3?$argv[1][md5(¡æyÚ.$i)%8]?$i&1?~ƒ:_:~ß:~õ;

A slight improvement using an md5 magic formula, but requires 3 additional binary bytes:

¡, æ, and Ú are characters 161, 230, and 218 respectively. It should work as is if copied directly, and saved as an ANSI format.

PHP 73 (70) bytes

<?for($s=327638584;3<$s;)echo++$i&3?$argv[1][7&$s/=8]?$i&1?'|':_:' ':'
';

If you'll allow me three binary characters, this can be reduced to 70 bytes:

<?for($s=327638584;3<$s;)echo++$i&3?$argv[1][7&$s/=8]?$i&1?~ƒ:_:~ß:~õ;

where ƒ, ß, and õ are characters 131, 223, and 245 respectively.

Receives input as a command line argument. Sample usage:

$ php seven-seg.php 1101101
 _
 _|
|_

$ php seven-seg.php 0111011

|_|
 _|


答:
05AB1E, 319 bytes

Uses CP-1252 encoding.

```<code>•9y†QHÚSe²ŒÓdéÓ#Ç§ÖN›Íˆž4GÏóREØån‡·JîÁØ£ÎÁ¥evÑRZ¶—¥1RËÒÆzçå"UNé¨v¯ÊcŒÔÝjðtrœÛeã&“SÁxÌ4Þá1N$ù?T(çÛbŸœfó˜lUž}Þß-©ÃMšBÈÑPàê#jÇÐ+n¼BDFý>–¸äFT×›qÜY³ö9ªòËùˆA‡¾p=‘¤ÚÞ{I¶Œ±Ål#¨5´Aq˜Àž,s<*Ï;‡õã¾»ðŽL´ÅuØö+Xi+S>»/8Kã~WÎ”ƒß”¤µðWluØa'cUÐeà¥ä…ž+œ6*0RU£›aÝQ_ñœoþÏð””Þã7ã¨sŒV`_É-´éÄèÆd¦úE5Í^Aá,‘‡™™¢äTHä0¥3±.}Søg•36B0„. :™J'yð:'z',:'.«
</code>```

Interpret the following string as a base 36 number and encode into base 214

```<code>LOREMYIPSUMYDOLORYSITYAMETZYCONSECTETURYADIPISCINGYELITZYSEDYDOYEIUSMODYTEMPORYINCIDIDUNTYUTYLABOREYETYDOLOREYMAGNAYALIQUA0UTYENIMYADYMINIMYVENIAMZYQUISYNOSTRUDYEXERCITATIONYULLAMCOYLABORISYNISIYUTYALIQUIPYEXYEAYCOMMODOYCONSEQUAT0DUISYAUTEYIRUREYDOLORYINYREPREHENDERITYINYVOLUPTATEYVELITYESSEYCILLUMYDOLOREYEUYFUGIATYNULLAYPARIATUR0EXCEPTEURYSINTYOCCAECATYCUPIDATATYNONYPROIDENTZYSUNTYINYCULPAYQUIYOFFICIAYDESERUNTYMOLLITYANIMYIDYESTYLABORUM
</code>```

After that we

```<code>36B                      # encode back into base 36
   0„. :                 # replace 0 with ". "
        ™J               # convert to titlecase and join
          'yð:           # replace "y" with <space>
              'z',:      # replace "z" with ","
                   '.«   # add a "." at the end
</code>```

For some reason the encoding didn't work with a 0 at the end which is why need a special case for the final ".".

Try it online!

Title: Output "Lorem ipsum" with minimal number of characters

Body:
I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.

How bad can it be?

In this challenge, you should output the following Lorem Ipsum text, taken from Wikipedia:

```<code>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</code>```

Please specify the number of characters (not bytes) in your code. Code with the minimal number of characters wins.

Your code should only contain valid Unicode characters, as described here, that is:

Code points up to U+10FFFF

No surrogates (the range D800–DBFF is forbidden)

No characters FFFE and FFFF

No null characters (code 0)

If your code cannot be displayed, provide a version with offending characters redacted, and a hexdump.

Some notes:

The output must be one long line (445 characters). If your system cannot do that (e.g. you're printing it on paper), output a closest approximation. Trailing linebreaks don't matter.

Built-in functions that generate Lorem Ipsum text are not allowed

Please specify a valid text encoding for your code, if relevant

Body:
05AB1E, 319 bytes

Uses CP-1252 encoding.

•9y†QHÚSe²ŒÓdéÓ#Ç§ÖN›Íˆž4GÏóREØån‡·JîÁØ£ÎÁ¥evÑRZ¶—¥1RËÒÆzçå"UNé¨v¯ÊcŒÔÝjðtrœÛeã&“SÁxÌ4Þá1N$ù?T(çÛbŸœfó˜lUž}Þß-©ÃMšBÈÑPàê#jÇÐ+n¼BDFý>–¸äFT×›qÜY³ö9ªòËùˆA‡¾p=‘¤ÚÞ{I¶Œ±Ål#¨5´Aq˜Àž,s<*Ï;‡õã¾»ðŽL´ÅuØö+Xi+S>»/8Kã~WÎ”ƒß”¤µðWluØa'cUÐeà¥ä…ž+œ6*0RU£›aÝQ_ñœoþÏð””Þã7ã¨sŒV`_É-´éÄèÆd¦úE5Í^Aá,‘‡™™¢äTHä0¥3±.}Søg•36B0„. :™J'yð:'z',:'.«

Interpret the following string as a base 36 number and encode into base 214

LOREMYIPSUMYDOLORYSITYAMETZYCONSECTETURYADIPISCINGYELITZYSEDYDOYEIUSMODYTEMPORYINCIDIDUNTYUTYLABOREYETYDOLOREYMAGNAYALIQUA0UTYENIMYADYMINIMYVENIAMZYQUISYNOSTRUDYEXERCITATIONYULLAMCOYLABORISYNISIYUTYALIQUIPYEXYEAYCOMMODOYCONSEQUAT0DUISYAUTEYIRUREYDOLORYINYREPREHENDERITYINYVOLUPTATEYVELITYESSEYCILLUMYDOLOREYEUYFUGIATYNULLAYPARIATUR0EXCEPTEURYSINTYOCCAECATYCUPIDATATYNONYPROIDENTZYSUNTYINYCULPAYQUIYOFFICIAYDESERUNTYMOLLITYANIMYIDYESTYLABORUM

After that we

36B                      # encode back into base 36
   0„. :                 # replace 0 with ". "
        ™J               # convert to titlecase and join
          'yð:           # replace "y" with <space>
              'z',:      # replace "z" with ","
                   '.«   # add a "." at the end

For some reason the encoding didn't work with a 0 at the end which is why need a special case for the final ".".

<a href="http://05ab1e.tryitonline.net/#code=4oCiOXnigKBRSMOaU2XCssWSw5Nkw6nDkyPDh8Knw5ZO4oC6w43LhsW-NEfDj8OzUkXDmMOlbuKAocK3SsOuw4HDmMKjw47DgcKlZXbDkVJawrbigJTCpTFSw4vDksOGesOnw6UiVU7DqcKodsKvw4pjxZLDlMOdasOwdHLFk8ObZcOjJuKAnFPDgXjDjDTDnsOhMU4kw7k_VCjDp8ObYsW4xZNmw7PLnGxVxb59w57Dny3CqcODTcWhQsOIw5FQw6DDqiNqw4fDkCtuwrxCREbDvT7igJPCuMOkRlTDl-KAunHDnFnCs8O2OcKqw7LDi8O5y4ZB4oChwr5wPeKAmMKkw5rDnntJwrbFksKxw4VsI8KoNcK0QXHLnMOAxb4sczwqw4874oChw7XDo8K-wrvDsMW9TMK0w4V1w5jDtitYaStTPsK7LzhLw6N-V8OO4oCdxpLDn-KAncKkwrXDsFdsdcOYYSdjVcOQZcOgwqXDpOKApsW-K8WTNiowUlXCo-KAumHDnVFfw7HFk2_DvsOPw7DigJ3igJ3DnsOjN8OjwqhzxZJWYF_DiS3CtMOpw4TDqMOGZMKmw7pFNcONXkHDoSzigJjigKHihKLihKLCosOkVEjDpDDCpTPCsS59U8O4Z-KAojM2QjDigJ4uIDrihKJKJ3nDsDoneicsOicuwqs&input=" rel="nofollow">Try it online!


答:
PowerShell v2+, 175 bytes

```<code>$d='$d={0}{1}{0}{2}-join(0..174|%{3}[char[]]($d-f [char]39,$d,"`n",[char]123,[char]125)|Random{4})'
-join(0..174|%{[char[]]($d-f [char]39,$d,"`n",[char]123,[char]125)|Random})
</code>```

Quines in PowerShell suck, because the string replacement delimiters {} also denote loops and whatnot, so you need to use a bunch of chars in the -f operator, which bloats the code.

Similar-ish to my Quine on Every Line answer. Basically we loop from 0 to 174 and each iteration re-calculate the quine $d, cast it as a char-array, and pull out a Random element chosen uniformly from the input. By definition, this gives probability (occurrences in source) / (length of source) as required. Those characters are encapsulated in parens and -joined together back into a string.

Example

```<code>PS C:\Tools\Scripts\golfing> .\faux-souce-code.ps1
}}[${hr[`ini}}] [5i,=[]0,j2($=n4(dm]jh]jc]]7
}..j"rnj9|fn,4r]{9]('["jdh0}$rd,-f,a.c"}{h1 ]5d,),0n5|nh(]73a9da4aRi[5}a}430}}rd$,$r)-hhr%or79-R.R-`'r'aa|=1f0][|[{7}do1]$ja0 rd{h
</code>```

(Yes, that's a newline in the output -- when a string containing a newline is char-array'd, the `n is treated as a character, since a char-array is just an array of byte codes, so it also has a 1/175th chance of being selected.)

Title: Faux Source Code

Body:
Output one random character for each character of source code (as illustrated below). The probability of each character is its frequency in the original source code. Thus the output will be fake source code resembling a quine.

Specification

Restrictions

Standard quine constrains apply. No empty programs or functions. Also no reading your own source.

Output

The number of characters output should be exactly the number of characters in the source code

Each output character should be randomly choosen

The probability of choosing any character is equal to (occurrences in source) / (length of source)

This means that even a unary solution needs to 'randomly' choose 1 with probability 1. Which is to say that the output can't be hard coded.

Winning

This is code golf, so fewest bytes wins

Example

```<code>Program           Frequency           Probability           Possible Output
-------           ---------           -----------           ---------------
 a@!@              a - 1               a - 25%               @@a@
                   ! - 1               ! - 25%
                   @ - 2               @ - 50%
</code>```

```<code>Program           Frequency           Probability           Possible Output
-------           ---------           -----------           ---------------
caBaDBcDaBDB       a - 3               a - 25%               aaaBBBBccDDD
                   B - 4               B - 33%
                   c - 2               c - 17%
                   D - 3               D - 25%
</code>```

Body:
PowerShell v2+, 175 bytes

$d='$d={0}{1}{0}{2}-join(0..174|%{3}[char[]]($d-f [char]39,$d,"`n",[char]123,[char]125)|Random{4})'
-join(0..174|%{[char[]]($d-f [char]39,$d,"`n",[char]123,[char]125)|Random})

Quines in PowerShell suck, because the string replacement delimiters {} also denote loops and whatnot, so you need to use a bunch of chars in the -f operator, which bloats the code.

Similar-ish to my Quine on Every Line answer. Basically we loop from 0 to 174 and each iteration re-calculate the quine $d, cast it as a char-array, and pull out a Random element chosen uniformly from the input. By definition, this gives probability (occurrences in source) / (length of source) as required. Those characters are encapsulated in parens and -joined together back into a string.

Example

PS C:\Tools\Scripts\golfing> .\faux-souce-code.ps1
}}[${hr[`ini}}] [5i,=[]0,j2($=n4(dm]jh]jc]]7
}..j"rnj9|fn,4r]{9]('["jdh0}$rd,-f,a.c"}{h1 ]5d,),0n5|nh(]73a9da4aRi[5}a}430}}rd$,$r)-hhr%or79-R.R-`'r'aa|=1f0][|[{7}do1]$ja0 rd{h

(Yes, that's a newline in the output -- when a string containing a newline is char-array'd, the `n is treated as a character, since a char-array is just an array of byte codes, so it also has a 1/175th chance of being selected.)


答:
Ruby, <s>81</s> 67 bytes

Saved a bunch of bytes by stealing some tricks from Martin's solution

```<code>s="s=%p;67.times{$><<(s%%s)[rand 67]}";67.times{$><<(s%s)[rand 67]}
</code>```

I didn't realize that you had to randomly select every time; I thought a shuffle would do the trick. This can probably be golfed, but it's the shortest I could get it.

Standard Ruby quine with a few modifications so it prints out the shuffled string. I'm sad because it took like fifteen minutes to figure out the formatting quirks before I realized that I was subconsciously stealing it anyway.

I think the string shuffling can be shortened but I don't know how; I might also be able to finagle the formatting into being shorter once I put some thought into it. Help would be appreciated.

Try it online!

Title: Faux Source Code

Body:
Ruby, <s>81</s> 67 bytes

Saved a bunch of bytes by stealing some tricks from Martin's solution

s="s=%p;67.times{$><<(s%%s)[rand 67]}";67.times{$><<(s%s)[rand 67]}

I didn't realize that you had to randomly select every time; I thought a shuffle would do the trick. This can probably be golfed, but it's the shortest I could get it.

Standard Ruby quine with a few modifications so it prints out the shuffled string. I'm sad because it took like fifteen minutes to figure out the formatting quirks before I realized that I was subconsciously stealing it anyway.

I think the string shuffling can be shortened but I don't know how; I might also be able to finagle the formatting into being shorter once I put some thought into it. Help would be appreciated.

Try it online!


问:
Count to 100 in Danish
Print all the numbers from 0-100 in the right order using the Danish way of counting

How they count

Like English, they have dedicated words for 0-20, 30, 40 and 100

Instead of saying twenty-one and twenty-two, they say one and twenty and two and twenty

Starting with fifty they say multiples of 10 as n*20

```<code>50 = half third times twenty = half way to the 3rd multiple of 20
60 = three times twenty
70 = half fourth times twenty
80 = four times twenty
90 = half fifth times twenty
</code>```

So for instance, 55 would be five and half third times twenty.

Expected output

```<code>zero
one
two
three
four
five
six
seven
eight
nine
ten
eleven
twelve
thirteen
fourteen
fifteen
sixteen
seventeen
eighteen
nineteen
twenty
one and twenty
two and twenty
three and twenty
four and twenty
five and twenty
six and twenty
seven and twenty
eight and twenty
nine and twenty
thirty
one and thirty
two and thirty
three and thirty
four and thirty
five and thirty
six and thirty
seven and thirty
eight and thirty
nine and thirty
forty
one and forty
two and forty
three and forty
four and forty
five and forty
six and forty
seven and forty
eight and forty
nine and forty
half third times twenty
one and half third times twenty
two and half third times twenty
three and half third times twenty
four and half third times twenty
five and half third times twenty
six and half third times twenty
seven and half third times twenty
eight and half third times twenty
nine and half third times twenty
three times twenty
one and three times twenty
two and three times twenty
three and three times twenty
four and three times twenty
five and three times twenty
six and three times twenty
seven and three times twenty
eight and three times twenty
nine and three times twenty
half fourth times twenty
one and half fourth times twenty
two and half fourth times twenty
three and half fourth times twenty
four and half fourth times twenty
five and half fourth times twenty
six and half fourth times twenty
seven and half fourth times twenty
eight and half fourth times twenty
nine and half fourth times twenty
four times twenty
one and four times twenty
two and four times twenty
three and four times twenty
four and four times twenty
five and four times twenty
six and four times twenty
seven and four times twenty
eight and four times twenty
nine and four times twenty
half fifth times twenty
one and half fifth times twenty
two and half fifth times twenty
three and half fifth times twenty
four and half fifth times twenty
five and half fifth times twenty
six and half fifth times twenty
seven and half fifth times twenty
eight and half fifth times twenty
nine and half fifth times twenty
one hundred
</code>```

Rules

You may use any separator to separate the numbers

Due to a typo in the original specification, you may use forth instead of fourth.

You may write a function or write to std-out

Standard loopholes apply

This is codegolf; shortest code in bytes win!

答:
Python 2, <s>359</s> <s>349</s> 345 Bytes

a='one two three four five six seven eight nine'.split()
c=['ten','eleven','twelve']+[i+'teen'for i in['thir',a[3],'fif',a[5],a[6],'eigh',a[8]]]
p=' times twenty'
h='half '
x=[p[7:],'thirty','forty',h+'third'+p,a[2]+p,h+'forth'+p,a[3]+p,h+'fifth'+p]
f=['zero']+a+c
for i in x:f+=[i];f+=[b+' and '+i for b in a]
for i in f+['one hundred']:print i
```

<h2>Explanation:</h2>

<p>Create a list of the first 9 numbers.<br>
Create a list of the next 10 numbers.<br>
Create a list of the endings - <code>twenty</code>, <code>thirty</code>, <code>forty</code>, <code>half third times twenty</code> etc<br>
Join the first two lists with <code>zero</code><br>
Append to the list each of the numbers from 50 onwards.<br>
Print out list</p>

<p>Ungolfed code:</p>

<pre class="lang-python prettyprint-override"><code>firstNumbers=['one','two','three','four','five','six','seven','eight','nine']
teenNumbers=['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']
endings=['twenty','thirty','forty','half third times twenty','three times twenty','half forth times twenty','four times twenty','half fifth times twenty']
joined=['zero']+firstNumbers+teenNumbers
for ending in endings:
    joined.append(ending)
    for number in firstNumbers:
        joined.append(number + 'and' + ending)
joined.append('one hundred')
for line in joined:
    print line
</code>```

Title: Count to 100 in Danish

Body:
Python 2, <s>359</s> <s>349</s> 345 Bytes

a='one two three four five six seven eight nine'.split()
c=['ten','eleven','twelve']+[i+'teen'for i in['thir',a[3],'fif',a[5],a[6],'eigh',a[8]]]
p=' times twenty'
h='half '
x=[p[7:],'thirty','forty',h+'third'+p,a[2]+p,h+'forth'+p,a[3]+p,h+'fifth'+p]
f=['zero']+a+c
for i in x:f+=[i];f+=[b+' and '+i for b in a]
for i in f+['one hundred']:print i

Explanation:

Create a list of the first 9 numbers.

Create a list of the next 10 numbers.

Create a list of the endings - twenty, thirty, forty, half third times twenty etc

Join the first two lists with zero

Append to the list each of the numbers from 50 onwards.

Print out list

Ungolfed code:

firstNumbers=['one','two','three','four','five','six','seven','eight','nine']
teenNumbers=['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']
endings=['twenty','thirty','forty','half third times twenty','three times twenty','half forth times twenty','four times twenty','half fifth times twenty']
joined=['zero']+firstNumbers+teenNumbers
for ending in endings:
    joined.append(ending)
    for number in firstNumbers:
        joined.append(number + 'and' + ending)
joined.append('one hundred')
for line in joined:
    print line


答:
JavaScript (ES5), 342 characters

```<code>c="remo ipsudlta,cngbq.UvxDhfE";"L"+"Qq©Úu[Qsx7Ķz`¾ƅ&Øxø§Ëƴ%ţ¾÷öm¿Zw¥ſøûƠtĭĚǎmĭöđnŔơxēǮŗĭ*x÷;ƚ:ȸƚņţǮ{XĩámɓŏƙâĚDUĚǎÁƚÂtĭŎÝ¦1mňŽ8ZUŽƜ-äļÝÁŌĪqu[Qqƙ¢3*ôĭ[ÞĵĪ%mÄſĘÚu[Q#èĭƝĘň®ŏØȅ˔Ż#ÂƠoƈŅƆĭƂ§ÿĵĭƘƙ¢VôƠţÅƠqƙƂĔňǮjʨſňô¾Ơn[ēĭœq÷\"ĭĚǎI".split('').map(function(x){y=x.charCodeAt(0);return c[~~(y/27)]+c[y%27]}).join('')
</code>```

Pretty straightforward, so I'm sure there's room for improvement. I encoded every pair of output characters as a single Unicode character.

Body:
JavaScript (ES5), 342 characters

c="remo ipsudlta,cngbq.UvxDhfE";"L"+"Qq©Úu[Qsx7Ķz`¾ƅ&Øxø§Ëƴ%ţ¾÷öm¿Zw¥ſøûƠtĭĚǎmĭöđnŔơxēǮŗĭ*x÷;ƚ:ȸƚņţǮ{XĩámɓŏƙâĚDUĚǎÁƚÂtĭŎÝ¦1mňŽ8ZUŽƜ-äļÝÁŌĪqu[Qqƙ¢3*ôĭ[ÞĵĪ%mÄſĘÚu[Q#èĭƝĘň®ŏØȅ˔Ż#ÂƠoƈŅƆĭƂ§ÿĵĭƘƙ¢VôƠţÅƠqƙƂĔňǮjʨſňô¾Ơn[ēĭœq÷\"ĭĚǎI".split('').map(function(x){y=x.charCodeAt(0);return c[~~(y/27)]+c[y%27]}).join('')

Pretty straightforward, so I'm sure there's room for improvement. I encoded every pair of output characters as a single Unicode character.


答:
JavaScript + jQuery + HTML + CSS (<s>210</s> 201)

This solution uses CSS sprites and the image provided as an example:

HTML (3)

```

<h3>CSS (<s>82</s> 71)</h3>

<p>Thanks to xem for the "<em>background:url</em>" trick:</p>

<pre class="lang-css prettyprint-override"><code>a{background:url(//bit.ly/VesRKL);width:13px;height:23px;display:block}
</code>```

JavaScript (125 after removing newlines added here for readability)

i=prompt();
x=-parseInt(i.substr(0,3),2)*23;
y=-parseInt(i.substr(3),2)*13.75;
$('a').css('background-position',y+'px '+x+'px');
```

Online test: http://jsfiddle.net/zhqJq/3/

Title: Emulate a 7-segment display

Body:
Task

The task is to display any of the 128 possible states of a
7-segment display.

Your program should accept a string of 7 characters ("bits") that are either 0 or 1.
First bit of input corresponds to segment A of the following illustration, the
second to B, etc (ignore dp):

How you represent the display is up to you -- a single Unicode or ASCII symbol,
ASCII art, grafically, or whatever you can come up with. However, each
input must have it's own distinct output. If you come up with something fancy I'm sure you can harvest upvotes by showing off some examples.

All 128 possible states of the display are:

Rules

Codegolf

As I said, any kind of output is allowed, but it would be nice if you specified it.

Input can be stdin or command line argument.

Examples

Input

```<code>1101101
</code>```

Output

As ASCII/Unicode:

```<code>2
</code>```

Different kinds of ASCII art (I'm not too good at this)

```<code> _   ╺┓  ╒╗   ---
 _|  ┏┛  ╔╝     |
|_   ┗╸  ╚╛   ---
              |
              ---
</code>```

Body:
JavaScript + jQuery + HTML + CSS (<s>210</s> 201)

This solution uses CSS sprites and the image provided as an example:

HTML (3)

<a>

CSS (<s>82</s> 71)

Thanks to xem for the "background:url" trick:

a{background:url(//bit.ly/VesRKL);width:13px;height:23px;display:block}

JavaScript (125 after removing newlines added here for readability)

i=prompt();
x=-parseInt(i.substr(0,3),2)*23;
y=-parseInt(i.substr(3),2)*13.75;
$('a').css('background-position',y+'px '+x+'px');

Online test: http://jsfiddle.net/zhqJq/3/


问:
Spell out the Revu'a
Actually not inspired neither by Atbash Self Palindromes nor by Generalized Gematria Calculator.

Given a string s of length n, output the Revu'a sequence, which is the first character of s, the first two characters of s, ... the first n–2 characters of s, the first n–1 characters of s, the entire s.

The string will only consist of Unicode (any encoding you want) characters that have strong directionality and are found in the range 0x0000 through 0xFFFF. However, no directionality control characters will occur. All characters in any given string will have the same directionality.

You may return in array notation ["t","te","tes","test"], as a space-separated string "t te tes test", as multi-line text
t
te
tes
test
, a pre-formatted array```t
te
tes
test```, or anything similar. Amounts of leading, separating, and trailing spacing is not important, and neither are trailing newline. Ask if in doubt.

Right-to-Left input must result in Right-to-Left output in proper order:

Input: "נחמן"

Output: "נ  נח  נחמ  נחמן" or```נ
נח
נחמ
נחמן
```, or ["נ","נח","נחמ","נחמן"]. Among invalid results are "נחמן  נחמ  נח  נ" ,"ן  מן  חמן  נחמן", and "נחמן  חמן  מן  ן".

答:
Pyth, 11 Bytes

```<code>Vlz=k+k@zNk
</code>```

Try It Out

Explanation

```<code>(z=input)
(k="")
V        for N in Range(
lz       length of z):
=k+k@zN     k=k+z[N]
k           print(k)
</code>```

Title: Spell out the Revu'a

Body:
Pyth, 11 Bytes

Vlz=k+k@zNk

Try It Out

Explanation

(z=input)
(k="")
V        for N in Range(
lz       length of z):
=k+k@zN     k=k+z[N]
k           print(k)


问:
Implement functional programming paradigms
Your company is just getting started on a project, and for the first time you decided to go use a functional programming code-style. However your boss is really diffident and doesn't want to use built-in functions, and requires you to implement yourself the main functions. In particular you need to write the functions: Map, Nest, Apply, Range, Fold and Table in a language on your choice. The boss is a really busy man, and he wants to have the programs as short as possible, so he doesn't waste time reading. He also would like not for you to use loops, therefore you will have a 10% reduction on the byte count for not using loops.

The detailed requirements of the functions are below:

Map

The Map function takes two parameters: f and list where f is a function and list is a list of values. It should return the f applied to each element of list. Therefore it will work as such:

```<code>Map(f,{a,b,c})
</code>```

returns

```<code>{ f(a), f(b), f(c) }
</code>```

and

```<code>Map(f, {{a,b},{b,c}})
</code>```

returns

```<code>{ f({a,b}), f({b,c})}
</code>```

Nest

The Nest function takes three parameters as well: f, arg, times where f is a function, arg is its starting argument, and times is how many times the function is applied. It should return an expression with f applied times times to arg. Therefore it will work as such:

```<code>Nest(f, x, 3)
</code>```

returns

```<code>f(f(f(x)))
</code>```

and

```<code>Nest(f, {a,b}, 3)
</code>```

returns

```<code>f(f(f({a,b})))
</code>```

Apply

The Apply function takes two parameters: f and args where f is a function and args a list. It should apply f to the args. Therefore:

```<code>Apply(f, {a,b,c})
</code>```

returns

```<code>f(a,b,c)
</code>```

Range

The Range function takes one integerr and outputs the integers up to that number. Therefore:

```<code>{ f(a), f(b), f(c) }
</code>```0

returns

```<code>{ f(a), f(b), f(c) }
</code>```1

Fold

The Fold function takes three parameters f, arg, others where f is a function, arg is simple parameter, and others a list. It will work as such:

```<code>{ f(a), f(b), f(c) }
</code>```2

returns

```<code>f(f(f(f(x,a),b),c),d)
</code>```

Table

The table functions should take a function f, and a parameter called iterator in the form: {iMin, iMax} where iMin and iMax are integers. You should apply f over the range specified. Therefore:

```<code>Table(f, {0, 5})
</code>```

returns

```<code>{f(0), f(1), f(2), f(3), f(4), f(5)}
</code>```

I've used the definition of these functions from the Mathematica functional programming page, so head there if you need any more guidance. Note that you will not need to implement all the version of the functions shown in that page, but only those written in this post.

Standard Loopholes are disallowed as usual.

In case your language does not allow functions to be passed as arguments, you need to implement this capability, and add it into your answer. However the byte-count of this operation will not be added to the total.

This is code golf so the shortest code wins. Good luck!!!

答:
Groovy (146 Bytes) (146*90%=131.4)

P.S. I don't know what you're considering as a 'loop' in this context, I only applied the bonus after I was told to in the comments by OP and will remove if 2-3 additional users say these collection functions and iterators are loops and that I don't deserve the bonus. Also, if you want to call me out on my use of 1..it, please do so and I will rework it / update my bytecount.

```<code>m={f,l->l.collect{f(it)}}            // Map
n={f,x,n->n.times{x=f(x)};x}         // Nest
a={f,l->f(l)}                        // Apply
r={1..it}                            // Range (Is this cheating?)
f={f,x,l->l.each{x=f(x,it)};x}       // Fold
t={f,l->(l[0]..l[1]).collect{f(it)}} // Table
</code>```

Example Input/Output

```<code>f1={2*it}
f2={a,b,c,d,e->a*b*c*d*e}
f3={a,b->a*b}
l=[1,2,3,4,5]
l2=[1,9]
y=5
x=1
println m(f1,l)
println n(f1,x,y)
println a(f2,l)
println r(y)
println f(f3,x,l)
println t(f1,l2)
</code>```

Output

```<code>MAP:   [2, 4, 6, 8, 10]
NEST:  32
APPLY: 120
RANGE: [1, 2, 3, 4, 5]
FOLD:  120
TABLE: [2, 4, 6, 8, 10, 12, 14, 16, 18]
</code>```

Try it yourself:
https://groovyconsole.appspot.com/edit/5203951758606336

Body:
Groovy (146 Bytes) (146*90%=131.4)

P.S. I don't know what you're considering as a 'loop' in this context, I only applied the bonus after I was told to in the comments by OP and will remove if 2-3 additional users say these collection functions and iterators are loops and that I don't deserve the bonus. Also, if you want to call me out on my use of 1..it, please do so and I will rework it / update my bytecount.

m={f,l->l.collect{f(it)}}            // Map
n={f,x,n->n.times{x=f(x)};x}         // Nest
a={f,l->f(l)}                        // Apply
r={1..it}                            // Range (Is this cheating?)
f={f,x,l->l.each{x=f(x,it)};x}       // Fold
t={f,l->(l[0]..l[1]).collect{f(it)}} // Table

Example Input/Output

f1={2*it}
f2={a,b,c,d,e->a*b*c*d*e}
f3={a,b->a*b}
l=[1,2,3,4,5]
l2=[1,9]
y=5
x=1
println m(f1,l)
println n(f1,x,y)
println a(f2,l)
println r(y)
println f(f3,x,l)
println t(f1,l2)

Output

MAP:   [2, 4, 6, 8, 10]
NEST:  32
APPLY: 120
RANGE: [1, 2, 3, 4, 5]
FOLD:  120
TABLE: [2, 4, 6, 8, 10, 12, 14, 16, 18]

Try it yourself:
https://groovyconsole.appspot.com/edit/5203951758606336


答:
JavaScript (ES7), <s>326</s> <s>283</s> <s>273</s> <s>249</s> <s>243</s> 242 chars

```<code>_=>""[r='replace'](/./gu,c=>(c.codePointAt()-4**8).toString(32))[r](/\d/g,d=>"  , exum. ".substr(d,2))[r](/^.|\. ./g,x=>x.toUpperCase())
</code>```

How it works

The first step in my compression technique is to convert the whole string to lowercase (not mandatory, but looks better), and replace each pair of chars in , exum.  (as well as the trailing space by itself) with its index in the string plus 2. This makes the text a valid base-32 number:

```<code>lorem9ips69dolor9sit9amet2consectetur9adipiscing3lit2sed9do3iusmod9tempor9incididunt9ut9labore3t9dolore9magna9aliqua8ut3nim9ad9minim9veniam2quis9nostrud94ercitation9ullamco9laboris9nisi9ut9aliquip943a9commodo9consequat8duis9aute9irure9dolor9in9reprehenderit9in9voluptate9velit3sse9cill69dolore3u9fugiat9nulla9pariatur84cepteur9sint9occaecat9cupidatat9non9proident2sunt9in9culpa9qui9officia9deserunt9mollit9anim9id3st9laboru7
</code>```

The next step is to convert each 4-char run to decimal, then get the character at that code point. This can be done with the following function:

```<code>f=s=>s.replace(/..../g,x=>(n=parseInt(x,32),String.fromCharCode(0xD800+(n>>10),0xDC00+(n&0x03FF))))
</code>```

(Note: Since all digits are 2 or greater, the minimum possible value of four digits is 2222₃₂. This is equal to 95978₁₀, or 176EA₁₆; therefore, code points will never be in the restricted range.)

And now we have our compressed string:

```<code>
</code>```

That's 445 chars compressed into 106 chars. The decompression simply reverses this process:

Convert each char to its code-point in base-32, minus 65536.

Replace each digit n with "  , exum. ".substr(n,2).

Convert each letter after a period or at the beginning of the string to uppercase.

The only ES7 feature used is **. Replace 4**8 with 65536 to run in a browser that doesn't yet support ES7.

Body:
JavaScript (ES7), <s>326</s> <s>283</s> <s>273</s> <s>249</s> <s>243</s> 242 chars

_=>""[r='replace'](/./gu,c=>(c.codePointAt()-4**8).toString(32))[r](/\d/g,d=>"  , exum. ".substr(d,2))[r](/^.|\. ./g,x=>x.toUpperCase())

How it works

The first step in my compression technique is to convert the whole string to lowercase (not mandatory, but looks better), and replace each pair of chars in , exum.  (as well as the trailing space by itself) with its index in the string plus 2. This makes the text a valid base-32 number:

lorem9ips69dolor9sit9amet2consectetur9adipiscing3lit2sed9do3iusmod9tempor9incididunt9ut9labore3t9dolore9magna9aliqua8ut3nim9ad9minim9veniam2quis9nostrud94ercitation9ullamco9laboris9nisi9ut9aliquip943a9commodo9consequat8duis9aute9irure9dolor9in9reprehenderit9in9voluptate9velit3sse9cill69dolore3u9fugiat9nulla9pariatur84cepteur9sint9occaecat9cupidatat9non9proident2sunt9in9culpa9qui9officia9deserunt9mollit9anim9id3st9laboru7

The next step is to convert each 4-char run to decimal, then get the character at that code point. This can be done with the following function:

f=s=>s.replace(/..../g,x=>(n=parseInt(x,32),String.fromCharCode(0xD800+(n>>10),0xDC00+(n&0x03FF))))

(Note: Since all digits are 2 or greater, the minimum possible value of four digits is 2222₃₂. This is equal to 95978₁₀, or 176EA₁₆; therefore, code points will never be in the restricted range.)

And now we have our compressed string:

That's 445 chars compressed into 106 chars. The decompression simply reverses this process:

Convert each char to its code-point in base-32, minus 65536.

Replace each digit n with "  , exum. ".substr(n,2).

Convert each letter after a period or at the beginning of the string to uppercase.

The only ES7 feature used is **. Replace 4**8 with 65536 to run in a browser that doesn't yet support ES7.


问:
4-way intersection generator
Here is an ASCII-art of a 4-way intersection:

```<code>     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----
     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
</code>```

(Note how the horizontal roads are 3 rows tall, while the vertical roads are 5 columns wide. This is for aesthetic reasons, because of the rectangular font.)

Your challenge is to produce this ASCII art. However, as I'm sure you all know, not every intersection has a road travelling off in every single direction. This particular intersection goes NESW, but some intersections might go, for example, NW:

```<code>     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
-----+-----+
     |     |
- - -|     |
     |     |
-----+-----+
</code>```

Or it might go SWE:

```<code>-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----
     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
</code>```

Or it may even go E, just a single direction (although you can hardly call this an intersection, but try to avoid being overly pedantic):

```<code>     +-----+-----
     |     |
     |     |- - -
     |     |
     +-----+-----
</code>```

You need to write a program or function that can easily generate any of these combinations. More specifically, your challenge is to write a program or function that takes a string of directions, consisting of NESW, as input, and outputs or returns this ASCII art of an intersection with roads pointing in those directions. These directions may appear in any order, but the input will not contain any characters except for N, E, S, or W. If you like, you may request inputs to be lowercase instead, but you must specify this in your answer. You may also assume that all inputs will contain at least one direction.

The last example had leading spaces on each line, because there is no road going west. If you do not have a road going west, these leading spaces are optional. This:

```<code>+-----+-----
|     |
|     |- - -
|     |
+-----+-----
</code>```

Would also be an acceptable output. Similarly, if N or S is gone, empty lines in there place are optional. One trailing newline is allowed, and trailing spaces are allowed as long as the output is visually the same.

You may take input and output in any reasonable format, such as STDIN/STDOUT, command line args, files, function arguments/return values, etc.

As usual, this is code-golf, so try to get the shortest possible answer in whatever language you happen to use!

Sample IO:

```<code>NESW:

     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----
     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |

NS:

|  |  |
|     |
|  |  |
|     |
|  |  |
+-----+
|     |
|     |
|     |
+-----+
|  |  |
|     |
|  |  |
|     |
|  |  |

S:

+-----+
|     |
|     |
|     |
+-----+
|  |  |
|     |
|  |  |
|     |
|  |  |

EW:

-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----

SE:
+-----+-----
|     |
|     |- - -
|     |
+-----+-----
|  |  |
|     |
|  |  |
|     |
|  |  |
</code>```

答:
sed 234

```<code>s,$,@+-----+@|     |@!     !@|     |@+-----+@,
:l;tl
/N/s,^,#,;t
:r
/S/s,@$,#,;t
/E/{s,!@,|- - -@,;s,+@,+-----@,g}
/W/{s,@!,@- - -|,;s,@+,@-----+,g;s,@|,@     |,g}
y,@!NSEW,\n|    ,
q
:
s,#,@|  |  |@|     |@|  |  |@|     |@|  |  |,
tr
</code>```

It just builds the different parts if the proper character is on the line.

Uses @ instead of \n and subs \n back in at the end.

The north and south parts are identical, so I use what's basically a function to insert them.

Title: 4-way intersection generator

Body:
sed 234

s,$,@+-----+@|     |@!     !@|     |@+-----+@,
:l;tl
/N/s,^,#,;t
:r
/S/s,@$,#,;t
/E/{s,!@,|- - -@,;s,+@,+-----@,g}
/W/{s,@!,@- - -|,;s,@+,@-----+,g;s,@|,@     |,g}
y,@!NSEW,\n|    ,
q
:
s,#,@|  |  |@|     |@|  |  |@|     |@|  |  |,
tr

It just builds the different parts if the proper character is on the line.

Uses @ instead of \n and subs \n back in at the end.

The north and south parts are identical, so I use what's basically a function to insert them.


问:
HexaGolf: Rotatagons
See also: Wordagons

Challenge

Given a hexagon and a number n as input, output the same hexagon rotated n times.

Hexagon

The hexagon will be a string like so:

```<code>  a b c
 d d e e
f f o g g
 h h i i
  j k l
</code>```

The hexagon will always be regular and will only ever contain the printable ASCII characters:

```<code> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
</code>```

Rotation

To find how much to rotate the hexagon by, multiply n by 60 degrees to get the angle of rotation. For example, using the above hexagon, if n is 2, we multiply that by 60 to get 120 degrees. Then, we rotate the hexagon by 120 degrees:

```<code>  j h f
 k h f d
l i o d a
 i g e b
  g e c
</code>```

Note that each side has moved two sides clockwise.

If n is positive, you should rotate the hexagon clockwise. If n is negative, you should rotate the hexagon anticlockwise.

n will always be an integer in the range -6 to 6 inclusive.

Examples

Input:

```<code>  . u .
 .  |  .
l - + - r
 .  |  .
  . d .
</code>```

n = 3

```<code>  . d .
 .  |  .
r - + - l
 .  |  .
  . u .
</code>```

Input:

```<code>  - - -
 /     \
<       >
 \     /
  - - -
</code>```

n = -1

Output:

```<code>  - \ >
 -     /
-       -
 /     -
  < \ -
</code>```

Input:

```<code>   h e x a
  g o n s a
 n d t r i a
n g l e s m a
 k e m e s a
  d l y m a
   d d e r
</code>```

n = 6

Output:

```<code>   h e x a
  g o n s a
 n d t r i a
n g l e s m a
 k e m e s a
  d l y m a
   d d e r
</code>```

Winning

The shortest program in bytes wins.

答:
Python 2, <s>160</s> <s>158</s> <s>156</s> <s>148</s> 124 bytes

Prepare to be amazed! The resulting text is drawn on a canvas... by a Turtle! :D

from turtle import*
h,n=input()
up()
rt(n*60)
l=0
for c in h:
 write(c);fd(9);l-=1
 if" ">c:fd(9*l);rt(90);fd(15);lt(90);l=0
```

Try it online - Supports decimal rotations as well!

If you would prefer the turtle to be shaped like one, you can add the line t.shape("turtle").

View the revision history to see past versions.

Aliases used:

up() - penup()

rt() - right()

lt() - left()

fd() - forward()

bk() - backward()

Thanks to Sherlock9 for the suggestions!

Title: HexaGolf: Rotatagons

Body:
Python 2, <s>160</s> <s>158</s> <s>156</s> <s>148</s> 124 bytes

Prepare to be amazed! The resulting text is drawn on a canvas... by a Turtle! :D

from turtle import*
h,n=input()
up()
rt(n*60)
l=0
for c in h:
 write(c);fd(9);l-=1
 if" ">c:fd(9*l);rt(90);fd(15);lt(90);l=0

Try it online - Supports decimal rotations as well!

If you would prefer the turtle to be shaped like one, you can add the line t.shape("turtle").

View the revision history to see past versions.

Aliases used:

up() - penup()

rt() - right()

lt() - left()

fd() - forward()

bk() - backward()

Thanks to Sherlock9 for the suggestions!


问:
Bitflip and negate
Given an integer, make an expression that produces it from 0 using unary negation - and bitwise complement ~ (~n = -n-1), with the operators applied right to left.

```<code>...
-3  = ~-~-~0
-2  = ~-~0
-1  = ~0
 0  = 0
 1  = -~0
 2  = -~-~0
 3  = -~-~-~0
...
</code>```

Your expression must be as short as possible, which means no redundant parts of ~~, --, -0, or 00. Output or print the expression as a string or a sequence of characters.

var QUESTION_ID=92598,OVERRIDE_USER=20260;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/92598/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Labyrinth, 25 bytes

```<code>`?+#~.
.  ; 6
54_"#2
  @!
</code>```

Try it online!

Explanation

I really like the control flow in this one. The IP runs in a figure 8 (or actually a ∞, I guess) through the code to reduce the input slowly to 0 while printing the corresponding characters.

The code starts in the upper left corner going right. The ` doesn't do anything right now. ? reads the input and + adds it to the implicit zero below. Of course that doesn't do anything either, but when we run over this code again, ? will push a zero (because we're at EOF), and + will then get rid of that zero.

Next the # pushes the stack depth, simply to ensure that there's a positive value on the stack to make the IP turn south, and ; discards it again.

The " is a no-op and acts as the main branch of the code. There are three cases to distinguish:

If the current value is positive, the IP turns right (west) and completes one round of the left loop:

```<code>_45.`?+
_45      Push 45.
   .     Print as character '-'.
    `    Negate the current value (thereby applying the unary minus).
     ?+  Does nothing.
</code>```

If the current value is negative, the IP turns left (east) and the following code is run:

```<code>#26.~
#        Push stack depth, 1.
 26      Turn it into a 126.
   .     Print as character '~'.
    ~    Bitwise NOT of the current value (applying the ~).
</code>```

Note that these two will alternate (since both change the sign of the input) until the input value is reduced to zero. At that point...

When the current value is zero, the IP simply keeps moving south, and executes the ! and then turns west onto the @. ! prints the 0 and @ terminates the program.

Title: Bitflip and negate

Body:
Labyrinth, 25 bytes

`?+#~.
.  ; 6
54_"#2
  @!

Try it online!

Explanation

I really like the control flow in this one. The IP runs in a figure 8 (or actually a ∞, I guess) through the code to reduce the input slowly to 0 while printing the corresponding characters.

The code starts in the upper left corner going right. The ` doesn't do anything right now. ? reads the input and + adds it to the implicit zero below. Of course that doesn't do anything either, but when we run over this code again, ? will push a zero (because we're at EOF), and + will then get rid of that zero.

Next the # pushes the stack depth, simply to ensure that there's a positive value on the stack to make the IP turn south, and ; discards it again.

The " is a no-op and acts as the main branch of the code. There are three cases to distinguish:

If the current value is positive, the IP turns right (west) and completes one round of the left loop:

_45.`?+
_45      Push 45.
   .     Print as character '-'.
    `    Negate the current value (thereby applying the unary minus).
     ?+  Does nothing.

If the current value is negative, the IP turns left (east) and the following code is run:

#26.~
#        Push stack depth, 1.
 26      Turn it into a 126.
   .     Print as character '~'.
    ~    Bitwise NOT of the current value (applying the ~).

Note that these two will alternate (since both change the sign of the input) until the input value is reduced to zero. At that point...

When the current value is zero, the IP simply keeps moving south, and executes the ! and then turns west onto the @. ! prints the 0 and @ terminates the program.


答:
Python, 54 Bytes

```<code>b='';y=input()
for a in range(len(y)):b+=y[a];print(b)
</code>```

Title: Spell out the Revu'a

Body:
Actually not inspired neither by Atbash Self Palindromes nor by Generalized Gematria Calculator.

Given a string s of length n, output the Revu'a sequence, which is the first character of s, the first two characters of s, ... the first n–2 characters of s, the first n–1 characters of s, the entire s.

The string will only consist of Unicode (any encoding you want) characters that have strong directionality and are found in the range 0x0000 through 0xFFFF. However, no directionality control characters will occur. All characters in any given string will have the same directionality.

You may return in array notation ["t","te","tes","test"], as a space-separated string "t te tes test", as multi-line text
t
te
tes
test
, a pre-formatted array```t
te
tes
test```, or anything similar. Amounts of leading, separating, and trailing spacing is not important, and neither are trailing newline. Ask if in doubt.

Right-to-Left input must result in Right-to-Left output in proper order:

Input: "נחמן"

Output: "נ  נח  נחמ  נחמן" or```נ
נח
נחמ
נחמן
```, or ["נ","נח","נחמ","נחמן"]. Among invalid results are "נחמן  נחמ  נח  נ" ,"ן  מן  חמן  נחמן", and "נחמן  חמן  מן  ן".

Body:
Python, 54 Bytes

b='';y=input()
for a in range(len(y)):b+=y[a];print(b)


问:
Convert to Bubble Letters
So I was playing around with my compose key, and found some cool things, one of them being that by pressing compose + ( + alphanumeric + ), you get that character inside a bubble, like so: ⓐ.

Your task in this challenge is simple, to convert ordinary text to bubble letter text.

Here are the ascii chars, the bubble characters and their Unicode code points:

```<code>0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
⓪①②③④⑤⑥⑦⑧⑨ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ
9450 9312 9313 9314 9315 9316 9317 9318 9319 9320 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423
</code>```

Your input will contain only printable ascii characters, and if a character cannot be bubbleified, leave it as is.

This is code-golf, so shortest code in bytes wins!

Note: This is not isomorphic to my earlier challenge about small-caps conversion since unlike small-caps, bubble letters are in a mostly contiguous segment of code-points, allowing for more interesting approaches.

答:
Python 3, 146 bytes

```<code>for p in list(input()):
 t=0
 if p.isdigit():t=9263
 if p=='0':t=9402
 if p.isalpha():
  t=9327
  if p.upper()==p:t=9333
 print(end=chr(ord(p)+t))
</code>```

This might be able to be made shorter, any help would be appreciated.
Try it on repl.it, here.

Title: Convert to Bubble Letters

Body:
Python 3, 146 bytes

for p in list(input()):
 t=0
 if p.isdigit():t=9263
 if p=='0':t=9402
 if p.isalpha():
  t=9327
  if p.upper()==p:t=9333
 print(end=chr(ord(p)+t))

This might be able to be made shorter, any help would be appreciated.
Try it on repl.it, here.


Title: 4-way intersection generator

Body:
Here is an ASCII-art of a 4-way intersection:

```<code>     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----
     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
</code>```

(Note how the horizontal roads are 3 rows tall, while the vertical roads are 5 columns wide. This is for aesthetic reasons, because of the rectangular font.)

Your challenge is to produce this ASCII art. However, as I'm sure you all know, not every intersection has a road travelling off in every single direction. This particular intersection goes NESW, but some intersections might go, for example, NW:

```<code>     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
-----+-----+
     |     |
- - -|     |
     |     |
-----+-----+
</code>```

Or it might go SWE:

```<code>-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----
     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
</code>```

Or it may even go E, just a single direction (although you can hardly call this an intersection, but try to avoid being overly pedantic):

```<code>     +-----+-----
     |     |
     |     |- - -
     |     |
     +-----+-----
</code>```

You need to write a program or function that can easily generate any of these combinations. More specifically, your challenge is to write a program or function that takes a string of directions, consisting of NESW, as input, and outputs or returns this ASCII art of an intersection with roads pointing in those directions. These directions may appear in any order, but the input will not contain any characters except for N, E, S, or W. If you like, you may request inputs to be lowercase instead, but you must specify this in your answer. You may also assume that all inputs will contain at least one direction.

The last example had leading spaces on each line, because there is no road going west. If you do not have a road going west, these leading spaces are optional. This:

```<code>+-----+-----
|     |
|     |- - -
|     |
+-----+-----
</code>```

Would also be an acceptable output. Similarly, if N or S is gone, empty lines in there place are optional. One trailing newline is allowed, and trailing spaces are allowed as long as the output is visually the same.

You may take input and output in any reasonable format, such as STDIN/STDOUT, command line args, files, function arguments/return values, etc.

As usual, this is code-golf, so try to get the shortest possible answer in whatever language you happen to use!

Sample IO:

```<code>NESW:

     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |
-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----
     |  |  |
     |     |
     |  |  |
     |     |
     |  |  |

NS:

|  |  |
|     |
|  |  |
|     |
|  |  |
+-----+
|     |
|     |
|     |
+-----+
|  |  |
|     |
|  |  |
|     |
|  |  |

S:

+-----+
|     |
|     |
|     |
+-----+
|  |  |
|     |
|  |  |
|     |
|  |  |

EW:

-----+-----+-----
     |     |
- - -|     |- - -
     |     |
-----+-----+-----

SE:
+-----+-----
|     |
|     |- - -
|     |
+-----+-----
|  |  |
|     |
|  |  |
|     |
|  |  |
</code>```

Body:
Groovy (274 Bytes)

Ungolfed

r{
    l->
    t='+-----+'
    s='     ';
    m='|     |'
    x='-----'
    v=(1..5).collect{s}
    nsR=(1..5).collect{[s,((it%2)?'|  |  |':m),s]}
    ewR=[x,s,'- - -',s,x]
    c=[l[3]?ewR:v,[t,m,m,m,t],l[1]?ewR:v]
    (l[0]?nsR.collect{it}:[])+((0..4).collect{x->((0..2).collect{y->c[y][x]})})+(l[2]?nsR.collect{it}:[])
}

Golfed

def i(l) {t='+-----+';s='     ';m='|     |';x='-----';v=(1..5).collect{s};n=(1..5).collect{[s,((it%2)?'|  |  |':m),s]};e=[x,s,'- - -',s,x];c=[l[3]?e:v,[t,m,m,m,t],l[1]?e:v];(l[0]?n.collect{it}:[])+((0..4).collect{x->((0..2).collect{y->c[y][x]})})+(l[2]?n.collect{it}:[])}

Try it: https://groovyconsole.appspot.com/script/5082600544665600


问:
Shortest 8-bit xor cipher
8-bit XOR encryption takes a single byte and XORs every byte in the file by that byte. Here is a reference program in C++:

```<code>/*xorcipher.cpp
 *Encrypts a file using 8-bit xor encrytpion
 */

#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;

int main(int argc, char** argv){
   ifstream* in = NULL;
   ofstream* out = NULL;

   if(argc < 3){
      cerr << "Usage: xor <key> <filename...>" << endl;
      exit(1);
   }

   int key = atoi(argv[1]);

   for(int x = 2; x < argc; x++){
      in = new ifstream(argv[x], ios::binary);
      if(!in->good()){
         cerr << "Error reading from " << argv[x] << endl;
         exit(1);
      }

      //Get file size
      in->seekg(0, ios::end);
      int size = in->tellg();
      in->seekg(0, ios::beg);

      //Allocate memory
      int* data = new int[size];

      int c = 0;
      for(int y = 0; (c = in->get()) != EOF; y++)
         data[y] = c ^ key;

      in->close();
      delete in;
      in = NULL;

      out = new ofstream(argv[x], ios::binary);
      if(!out->good()){
         cerr << "Error writing to " << argv[x] << endl;
         exit(1);
      }

      for(int y = 0; y < size; y++)
         out->put(data[y]);

      out->flush();
      out->close();
      delete out;
      out = NULL;

      delete[] data;
      data = NULL;
   }
   cout << "Operation complete" << endl;

   return 0;
}
</code>```

The shortest answer (whitespace doesn't count) that produces the same end result will be selected. It does not have to store everything in memory at once or open and close every file multiple times. It can do anything as long as a file encrypted with the reference program can be decrypted with the answer, and vice versa.

Edit: The above program is not a specification. The only requirement is that answers should be able to decrypt a file encrypted with the above program, and the above program should be able to decrypt a file encrypted with the answer. I'm sorry if that was unclear.

The above program can be compiled with:

```<code>g++ xorcipher.cpp -o ~/bin/xor
</code>```

It can be run like this:

```<code>xor <key> <filename...>
</code>```

For example, if the key is 42 and the file is alpha.txt, you would use:

```<code>xor 42 alpha.txt
</code>```

答:
GolfScript, 16 characters

```<code>"#{$*}"~{^}+%:n;
</code>```

Usage is as given above - the key (numeric) passed as parameter while input/output is through console:

```<code>golfscript.rb xor.gs 42 <in.txt >out.txt
</code>```

Edit: The issues with the trailing newline are now solved.

Title: Shortest 8-bit xor cipher

Body:
GolfScript, 16 characters

"#{$*}"~{^}+%:n;

Usage is as given above - the key (numeric) passed as parameter while input/output is through console:

golfscript.rb xor.gs 42 <in.txt >out.txt

Edit: The issues with the trailing newline are now solved.