问:
Battle of the Fellowships KotH
In this challenge, you are going to create a Fellowship with the goal of defeating all other fellowships in battle.

A fellowship (team) consists of 3 characters.  Each character moves independently of the rest of their team, but they will need to work together when fighting your enemy. Teams will face each other head to head in a rotating manner.  Wins are worth 3 points, ties are worth 1 point, and losses are worth 0 points.

Characters have Abilities. The choice of what abilities your characters have is one of the most crucial (and fun) parts in this KotH.  They are all strong, and have the potential to wipe out your enemy.

Characters have Health Points (HP), and when their HP hits (or goes below) 0, they die.  If all characters on your opponent's team dies, then you win!

Characters have Mana.  Most actions require Mana to perform, and if you don't have enough, that action is not available to you.

Characters have a Turn Delay.  This determines the number of ticks between each turn (starts out at 100).  Lower is better.

Characters have attributes.  Each character has a base of 5 in each attribute, and you are given 20 additional attribute points to divide up.  After assigning attribute points, your primary attribute is set as your highest attribute.

Available attributes are:

Strength:  Gives 10 Max HP and .5 HP per turn

Intelligence: Gives 7 Max Mana and .1 Mana per turn

Agility: Reduces Turn Delay by 1

Movement, Vision, Range

Ranges are as follows (centered around the 0).  Some ranges are cardinal, which means that they can only go directly up, left, right, or down.

```<code>    444
   43334
  4322234
 432111234
 432101234
 432111234
  4322234
   43334
    444
</code>```

Characters have a starting vision of 2.  Vision between players of the same fellowship is shared.

How to play

Construction

Players will construct their fellowship.  You need to do the following steps:

Give each character attribute points.  Each character starts out with 5 in each stat, with an additional 20 to distribute between the 3.

Give each character abilities.  Each character starts out with 4 ability slots, and abilities take 1 slot by default.  Some abilities are repeatable, and can be given to a character multiple times.  Using an ability set of another submission without the owner's permission is not allowed.

Write some code for your bots.  The code must be in Java, and will be used for battling (the next step)

Actions

All characters start with the 3 standard actions:

Step: Move your character in a cardinal range of 1

Slice: Attack an enemy for PrimaryAttribute in a cardinal range of 1

Smile: Do nothing

On a characters' turn, then must pick an action to perform.  Actions may have a Mana cost, and may have a Cooldown, which defines the number of turns you have to wait before performing that action again.

Abilities

Every character has 4 ability slots.  If an ability is in italics, it is an action.

Abilities

```
Name         Description                                                                Mana  Cooldown
                                                    <b>Mobility</b>

<i>Blink</i>        Move to a square, range 4                                                     2         2
<i>Swap</i>         Swap locations with Target                                                    5         5
<i>Teleport</i>     Move anywhere                                                                20         5

Dash         Increase the range of step by 1. Repeatable
Mobile       Step can move in any of the 8 directions
                                                    <b>Attacking</b>

<i>Quick</i>        Slice twice                                                                   3         0
<i>Weave</i>        Slice all visible enemies once                                               15        10

Absorb       Each Slice steals 1 of your target's primary attribute. Lasts 20 turns
Cleave       Each Slice deals 1/2 damage to adjacent enemies
Critital     Adds a 30% chance for Slice to deal 200% damage. Repeatable
Feast        Each Slice increases your HP by 3. Repeatable
Flexible     Can Slice in any of the 8 directions
Mana steal   Slice steals 2 mana. Repeatable
Reflexive    Slice when sliced                                                             0         3
Ranged       Adds 1 to the range of Slice
Swipe        Each consecutive Slice on the same target deals 3 more damage than the last
                                                    <b>Statuses</b>

<i>Dispel</i>       Removes all statuses from a Target. Range 2.                                 20        10
<i>Duel</i>         Freezes you and your target until one of you dies. Range 1                   25         0
<i>Knockout</i>     You and target are stunned for the next 1000 ticks                           10        10
<i>Meteor</i>       All enemies are stunned for the next 100 ticks                               25        10
<i>Leash</i>        Target is frozen for their 2 next turns                                       4         6
<i>Poison</i>       Poisons the enemy for 1 HP for 5 turns                                        5         0
<i>Silence</i>      Target is silenced for 5 turns                                                5         7
<i>Slow</i>         Target is slowed by 40 ticks for their next 3 turns                          10         5
<i>Stun</i>         Target is stunned for the next 300 ticks                                     10        10

Cold         All other characters within 2 range are slowed by 10 ticks
Immune       No status can be applied to you
                                                    <b>Defensive</b>

<i>Force Field</i>  Block next 5 sources of damage. Does not stack                               15         5
<i>Ghost</i>        For a turn, all damage heals                                                 10        10
<i>Heal</i>         Heal Target for 20 HP                                                        10         3
<i>Restore</i>      All units are restored back to full health                                   20        40
<i>Shield</i>       You cannot be Sliced until your next turn                                     3         0

Evasive      25% chance for a Slice to not hit you. Repeatable
Pillar       Only can be sliced once a turn
Resurrect    When killed, come back to life with full HP (and no statuses)                 0        40
Spikes       When dealt damage, deal half of the damage back
                                                     <b>Vision</b>

<i>Cloak</i>        Team becomes invisible for 5 turns                                           20        20
<i>Hide</i>         You are invisible for 5 turns                                                 4         7
<i>Phase</i>        Become invisible for 1 turn                                                   0         3
<i>Track</i>        Target cannot go invisible, and takes 10% more damage. Lasts 10 turns.        5         5

Darkness     Enemy sight range decreased by 1. Stacks, but cannot go below 1.
Far sight    Sight range increased by 2. Repeatable
Invisible    You are invisible if you start your turn out of enemy vision
True sight   Reveals all hidden units within range 2 at turn start
                                                     <b>Damage</b>

<i>Drain</i>        Deals 5 damage to Target and heals self for 5 HP while they stay in 1 range  10         5
<i>Lightning</i>    Deal 15 damage to all enemies                                                20        10
<i>K/O</i>          Kills target if target is below 20% HP                                       20         0
<i>Trap</i>         Place an invisible trap. Trap deals 15 damage when stepped on. Stacks.       10         2
<i>Zap</i>          Deal 30 damage to target                                                     30         5

Static       Deals 5 damage every turn to all enemies within 1 range. Repeatable
                                                      <b>Stats</b>

<i>Werewolf</i>     Add 10 to all stats for 5 turns                                              30        25

Buff         Double your HP pool. Repeatable
Clever       Actions have 20% shorter cooldown. Repeatable
Focused      Increases your Mana regeration rate by Int/10. Repeatable
Regenerate   Increases your Regneration rate by Strength/2. Repeatable
Smart        Actions cost 2 less mana. Repeatable
Strong       You gain 10 attribute points. Repeatable
Weak         You lose 15 attribute points. You gain 2 ability slots (this takes one of them)
                                                      <b>Other</b>

<i>Bear</i>         Can summon a bear which has 5 in each stat                                    8        10
<i>Clone</i>        Clone yourself. Takes two ability slots.                                    100       100
<i>Steal</i>        Replace this action with last action enemy Target used. Lasts 10 turns        5         0
<i>Wall</i>         Create an impassible wall on targetted empty square, range 6                 10        10
```

Statuses:

Stun allows your character to only perform the Smile action, and lasts X ticks.

Freeze prevents your character from moving, and lasts X turns.

Silence prevents your character from performing anything besides Smile, Step, or Slice, and lasts X turns.

Poison damages your character for X damage for Y turns.  If you apply another poison, the damage adds together, and the duration is refreshed.

Slow adds X to the number of ticks between your turns.  It does not affect your upcoming turn, only turns after.

Invisible makes it so you cannot be seen or damaged by your opponent.  If you perform any action besides Step or Smile, it is removed.  If your opponent has an ability that gives them vision of you, invisibility is removed.

All statuses (except for Poison) act independently of each other.

Side Notes:

If there's a tie for the primary attribute, it is resolved as STR > AGI > INT.

You play on a 10x10 grid.  Teams will be placed on opposite sides.

Percentages stack multiplicatively, except for Clever.

Submission rules

You need to implement 2 functions:

```<code>// Create *exactly* 3 Character templates.  You must return the same templates every time
public List<CharacterTemplate> createCharacters();

// Choose an action for a character.  If the action requires a target or location, it must be set.
public ReadonlyAction choose(Set<ReadonlyAction> actions, ReadonlyCharacter character);
</code>```

You'll also have access to three variables (member variables):

```<code>Set<ReadonlyCharacter> team;
Set<EnemyCharacter> enemies;
Map<Point2D, EnemyCharacter> visibleEnemies;
</code>```

That's it.  Below you can find a complete API, in alphabetical order:

```<code>class Ability and ReadonlyAbility
    int getNumSlots() returns the number of slots it takes up
    boolean repeatable() returns true if the ability can be repeated
    String name()
class Action and ReadonlyAction
    Set<Point2D> availableLocations()
    Set<ReadonlyCharacter> availableTargets()
    boolean basicAction() returns true if the action is Smile, Step, or Slice
    boolean breaksInvisibiliby()
    int getCooldown() returns the cooldown cost (not the cooldown remaining)
    int getManaCost()
    String getName()
    int getRemainingCooldown()
    boolean isAvailable() returns true if the action can be performed
    boolean movementAction() returns true if the action is prevented when Frozen
    boolean needsLocation()
    boolean needsTarget()
    void setTarget(ReadonlyCharacter target)
    void setLocation(Point2D location)
class CharacterTemplate
    void addAbility(Ability)
    boolean canAddAbility(Ability)
    List<Ability> currentAbilities()
    Map<Stat, Integer> currentAttributes()
    int getRemainingPoints() returns the total number of ability points you have left to assign
    int getRemainingSlots() returns the total number of slots you have to assign
    int getStat(Stat stat)
    boolean isValid() returns true if your character template is complete and valid
class Point2D
    getX()
    getY()
class Range
    boolean isCardinal() returns true if the range only extends in the 4 cardinal directions
    int getRange() returns the distance of the range
class ReadonlyCharacter and EnemyCharacter
    Class characterClass()
    int cleverness()
    List<ReadonlyAbility> getAbilities()
    Point2D getLocation()   Not on EnemyCharacter
    double getHealth()
    double getMana()
    int getMaxHealth()
    int getMaxMana()
    Range getSightRange()
    Range getSliceRange()
    int getStat(Stat stat)
    Range getStepRange()
    ReadonlyAction getLastAction()
    boolean isFrozen()
    boolean isStunned()
    boolean isPoisoned()
    int getPoisonAmount()
    boolean isSilenced()
    boolean isInvisible()
    boolean isDead()
    Stat primaryStat()
    int smartness()
enum Stat
    INT, STR, AGI
</code>```

The above is all of the functions you could possibly need for your submission. Reflection is not allowed.  If a submission is invalid for whatever reason, please remove it or add "Invalid" to the header.  Your submission should not have a package declaration.  Your submission should be contained in the first multi-line code block, and the first line must have the file name.

How to run the project:

There are several ways:

Download the JAR file, and run java -jar Fellowship.jar.  If you want to download other submissions, pass -q 99744. java must point to the JDK, not the JRE.

Clone the git repo, and run gradle run. You need to have gradle installed, and if you want to pass arguments, use -PappArgs="['arg1', 'args2']"

Clone the git repo, and compile it yourself.  You will need the following libraries: org.eclipse.collections:eclipse-collections-api:8.0.0,org.eclipse.collections:eclipse-collections:8.0.0,com.beust:jcommander:1.48,com.google.code.gson:gson:2.7,org.jsoup:jsoup:1.9.2

If you clone you must use the --recursive flag, and when you pull updates, include --recurse-submodules For any of the above, your class needs to go in the submissions/java folder.  If you are using gradle, or compiling it yourself, you can put the class in the project itself.  You will need to uncomment some lines in the main function, and update them to point to your class.

Scoreboard:

```<code>+------+-------------------+-------+
| Rank | Name              | Score |
+------+-------------------+-------+
|    1 | TheWalkingDead    | 738.0 |
|    2 | RogueSquad        | 686.0 |
|    3 | Spiky             | 641.0 |
|    4 | Invulnerables     | 609.0 |
|    5 | Noob              | 581.0 |
|    6 | Railbender        | 561.0 |
|    7 | Vampire           | 524.0 |
|    8 | LongSword         | 508.0 |
|    9 | SniperSquad       | 456.0 |
|   10 | BearCavalry       | 430.0 |
|   11 | StaticCloud       | 429.0 |
|   12 | PlayerWerewolf    | 388.0 |
|   13 | LongSwordv2       | 347.0 |
|   14 | Derailer          | 304.0 |
|   15 | Sorcerer          | 266.0 |
|   16 | CowardlySniperMk2 | 262.0 |
|   17 | TemplatePlayer    |  59.0 |
+------+-------------------+-------+
</code>```

If you have any questions, or need help, comment below, or join the chatroom!  Good luck and have fun

答:
Template Player

Uses Ranged, Flexible, Zap, and KO.  You have permission to use this ability set if you wish.

Feel free to use this bot as a template for creating your own.

Remember that you need to change the filename on the first line, as well as selecting your own ability set.

```<code>TemplatePlayer.java
import com.nmerrill.kothcomm.game.maps.Point2D;
import fellowship.abilities.ActionAbility;
import fellowship.abilities.attacking.Flexible;
import fellowship.abilities.attacking.Ranged;
import fellowship.actions.ReadonlyAction;
import fellowship.actions.damage.KO;
import fellowship.actions.damage.Zap;
import fellowship.characters.CharacterTemplate;
import fellowship.characters.ReadonlyCharacter;
import fellowship.Player;
import org.eclipse.collections.api.set.MutableSet;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

public class TemplatePlayer extends Player{
    private final double CRITICAL_HEALTH = 20;
    @Override
    public List<CharacterTemplate> createCharacters() {
        List<CharacterTemplate> templates = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            templates.add(new CharacterTemplate(10, 5, 5,
                    new Ranged(),
                    new Flexible(),
                    new ActionAbility(KO::new),
                    new ActionAbility(Zap::new)));
        }
        return templates;
    }

    @Override
    public ReadonlyAction choose(Set<ReadonlyAction> actions, ReadonlyCharacter character) {
        int minPriority = Integer.MAX_VALUE;
        ReadonlyAction chosen = null;
        for (ReadonlyAction action: actions){
            int priority = getPriorityFor(action, character);
            if (priority < minPriority){
                chosen = action;
                minPriority = priority;
            }
        }
        if (chosen == null){
            throw new RuntimeException("No valid actions");
        }
        if (chosen.needsLocation()){
            chosen.setLocation(chooseLocationFor(chosen, character));
        } else if (chosen.needsTarget()){
            chosen.setTarget(chooseTargetFor(chosen));
        }
        return chosen;
    }

    private Point2D chooseLocationFor(ReadonlyAction action, ReadonlyCharacter character){
        if (action.movementAction()){
            if (character.getHealth() < CRITICAL_HEALTH){
                return fromEnemy(action.availableLocations());
            } else {
                return toEnemy(action.availableLocations());
            }
        }
        return toTeam(action.availableLocations());
    }

    private Point2D toEnemy(MutableSet<Point2D> availableLocations){
        if (visibleEnemies.isEmpty()){
            return availableLocations.iterator().next();
        }
        return availableLocations.minBy(p1 ->
                p1.cartesianDistance(visibleEnemies.keysView().minBy(p1::cartesianDistance))
        );
    }

    private Point2D fromEnemy(MutableSet<Point2D> availableLocations){
        if (visibleEnemies.isEmpty()){
            return availableLocations.iterator().next();
        }
        return availableLocations.maxBy(p1 ->
                p1.cartesianDistance(visibleEnemies.keysView().minBy(p1::cartesianDistance))
        );
    }

    private Point2D toTeam(MutableSet<Point2D> availableLocations){
        if (team.isEmpty()){
            return availableLocations.iterator().next();
        }
        return availableLocations.minBy(p1 ->
                p1.cartesianDistance(team.collect(ReadonlyCharacter::getLocation).minBy(p1::cartesianDistance))
        );
    }

    private ReadonlyCharacter chooseTargetFor(ReadonlyAction action){
        return action.availableTargets().minBy(ReadonlyCharacter::getHealth);
    }

    private int getPriorityFor(ReadonlyAction action, ReadonlyCharacter character){
        if (character.isInvisible() && action.breaksInvisibility()){
            return 1000;
        }
        if (action.getName().equals("Smile")){
            return 999;
        }
        if (action.movementAction()){
            if (character.getHealth() < 20){
                return 0;
            }
            return 998;
        }
        if (action.needsTarget()) {
            return ((int) action.availableTargets().minBy(ReadonlyCharacter::getHealth).getHealth());
        }
        return 997;
    }
}
</code>```

Title: Battle of the Fellowships KotH

Body:
Template Player

Uses Ranged, Flexible, Zap, and KO.  You have permission to use this ability set if you wish.

Feel free to use this bot as a template for creating your own.

Remember that you need to change the filename on the first line, as well as selecting your own ability set.

TemplatePlayer.java
import com.nmerrill.kothcomm.game.maps.Point2D;
import fellowship.abilities.ActionAbility;
import fellowship.abilities.attacking.Flexible;
import fellowship.abilities.attacking.Ranged;
import fellowship.actions.ReadonlyAction;
import fellowship.actions.damage.KO;
import fellowship.actions.damage.Zap;
import fellowship.characters.CharacterTemplate;
import fellowship.characters.ReadonlyCharacter;
import fellowship.Player;
import org.eclipse.collections.api.set.MutableSet;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

public class TemplatePlayer extends Player{
    private final double CRITICAL_HEALTH = 20;
    @Override
    public List<CharacterTemplate> createCharacters() {
        List<CharacterTemplate> templates = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            templates.add(new CharacterTemplate(10, 5, 5,
                    new Ranged(),
                    new Flexible(),
                    new ActionAbility(KO::new),
                    new ActionAbility(Zap::new)));
        }
        return templates;
    }

    @Override
    public ReadonlyAction choose(Set<ReadonlyAction> actions, ReadonlyCharacter character) {
        int minPriority = Integer.MAX_VALUE;
        ReadonlyAction chosen = null;
        for (ReadonlyAction action: actions){
            int priority = getPriorityFor(action, character);
            if (priority < minPriority){
                chosen = action;
                minPriority = priority;
            }
        }
        if (chosen == null){
            throw new RuntimeException("No valid actions");
        }
        if (chosen.needsLocation()){
            chosen.setLocation(chooseLocationFor(chosen, character));
        } else if (chosen.needsTarget()){
            chosen.setTarget(chooseTargetFor(chosen));
        }
        return chosen;
    }

    private Point2D chooseLocationFor(ReadonlyAction action, ReadonlyCharacter character){
        if (action.movementAction()){
            if (character.getHealth() < CRITICAL_HEALTH){
                return fromEnemy(action.availableLocations());
            } else {
                return toEnemy(action.availableLocations());
            }
        }
        return toTeam(action.availableLocations());
    }

    private Point2D toEnemy(MutableSet<Point2D> availableLocations){
        if (visibleEnemies.isEmpty()){
            return availableLocations.iterator().next();
        }
        return availableLocations.minBy(p1 ->
                p1.cartesianDistance(visibleEnemies.keysView().minBy(p1::cartesianDistance))
        );
    }

    private Point2D fromEnemy(MutableSet<Point2D> availableLocations){
        if (visibleEnemies.isEmpty()){
            return availableLocations.iterator().next();
        }
        return availableLocations.maxBy(p1 ->
                p1.cartesianDistance(visibleEnemies.keysView().minBy(p1::cartesianDistance))
        );
    }

    private Point2D toTeam(MutableSet<Point2D> availableLocations){
        if (team.isEmpty()){
            return availableLocations.iterator().next();
        }
        return availableLocations.minBy(p1 ->
                p1.cartesianDistance(team.collect(ReadonlyCharacter::getLocation).minBy(p1::cartesianDistance))
        );
    }

    private ReadonlyCharacter chooseTargetFor(ReadonlyAction action){
        return action.availableTargets().minBy(ReadonlyCharacter::getHealth);
    }

    private int getPriorityFor(ReadonlyAction action, ReadonlyCharacter character){
        if (character.isInvisible() && action.breaksInvisibility()){
            return 1000;
        }
        if (action.getName().equals("Smile")){
            return 999;
        }
        if (action.movementAction()){
            if (character.getHealth() < 20){
                return 0;
            }
            return 998;
        }
        if (action.needsTarget()) {
            return ((int) action.availableTargets().minBy(ReadonlyCharacter::getHealth).getHealth());
        }
        return 997;
    }
}


问:
Score a hand of Hearts
Hearts is a trick-taking card game for 4 players. Each trick is taken by the player who played the highest card of the leading suit. At the end of each hand, the players incur a penalty score depending on the penalty cards they have taken; the task is to determine the scores under Microsoft Hearts rules.

Input

Input is 4 lists (or delimited string, array, etc.) showing the penalty cards taken by each of the 4 players. The penalty cards are

```<code>2♥, 3♥, 4♥, 5♥, 6♥, 7♥, 8♥, 9♥, 10♥, J♥, Q♥, K♥, A♥, Q♠
</code>```

which we shall represent as

```<code>2,  3,  4,   5,  6,  7,  8,  9,  10,  11, 12,  13,  1,  0
</code>```

respectively.

Output

Output is the 4 penalty points incurred by the 4 players (list, string, array etc.). Scoring is as follows:

Each heart (♥, represented by integers 1 to 13 inclusive) incurs 1 point

The queen of spades (Q♠, represented by 0) incurs 13 points

Exception: if a player has taken all of the penalty cards (called shooting the moon), then he incurs 0 points, while all other players incur 26 points.

Test cases

```<code>[2, 8, 7, 1], [3, 4], [], [9, 5, 6, 0, 10, 11, 12, 13]     -->  4,  2,  0, 20
[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [], [], [1]   --> 25,  0,  0,  1
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0], [], [], [] -->  0, 26, 26, 26
</code>```

Shortest code in bytes wins.

答:
Python 3, 101 bytes

```<code>def s(a):r=[sum([(1,13)[c==0]for c in h])for h in a];s=(r,[(26,0)[s==26]for s in r]);return s[26in r]
</code>```

Full code:

```<code>def score(hands):
    result = [sum([(1, 13)[card == 0] for card in hand]) for hand in hands]
    results = (result, [(26, 0)[score == 26] for score in result])
    return results[26 in result]
</code>```

ContentLicense: CC BY-SA 3.0

Title: Score a hand of Hearts

Body:
Python 3, 101 bytes

def s(a):r=[sum([(1,13)[c==0]for c in h])for h in a];s=(r,[(26,0)[s==26]for s in r]);return s[26in r]

Full code:

def score(hands):
    result = [sum([(1, 13)[card == 0] for card in hand]) for hand in hands]
    results = (result, [(26, 0)[score == 26] for score in result])
    return results[26 in result]


答:
Python 2, 46 bytes

```<code>import textwrap as t;print t.fill('_|__'*175)
</code>```

I was going to do an exec loop similar to @xnor's one alternate solution but he/she got to it before me. I guess I'll just have to let Python do the dirty work for me.

Title: Build me a brick wall!

Body:
Challenge

I need help building a brick wall! Throw together some code for me
 using no input and produce the following output wall shown below:

```<code>_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
</code>```

Now, this wall is exactly 10 characters high and 70 characters
 wide.

As stated above, no inputs, only code. Least amount of bytes, we have
 to efficiently build this brick wall. Obviously, this program has to
 function to get the wall built..? or it obviously won't build itself!
 Good luck!

Winner

The winner goes to Marinus using the APL language, requiring a whole 12 bytes!
https://codegolf.stackexchange.com/a/99028/61857

Thank you everyone for participating!

Body:
Python 2, 46 bytes

import textwrap as t;print t.fill('_|__'*175)

I was going to do an exec loop similar to @xnor's one alternate solution but he/she got to it before me. I guess I'll just have to let Python do the dirty work for me.


问:
Quine Anagrams! (Cops' Thread)
This is the cops' thread. For the robbers' thread, click here.

Cops' Task

First, write a quine in a language of your choosing.

Next, scramble the quine. Make sure to do this well as the robbers will be trying to unscramble it and find the original source code! Note that the scrambled code does not need to work.

Post an answer on this thread. Include the language, the byte count, and the scrambled code.

Your program may not print to STDERR.

Here is an example of a cop submission:

Python, 29 bytes

```<code>nt _%=_r;_riinp;pr_='t _%%%_'
</code>```

Robbers' Task

For the robbers' thread, click here.

Safe Submissions

If your submission has not yet been cracked after a week of posting, you may add the solution and specify that it is safe. If you do not, your submission may still be cracked.

Scoring

This is code-golf, so the user with the safe submission with the fewest bytes will be the winner of this section.

Leaderboard

Here is a stack snippet to generate a learderboard for this challenge. For it to display properly, please format your submission like this:

```<code># Language Name, N bytes

... other stuff ...
</code>```

If your submission gets cracked, please format like this:

```<code># Language Name, N bytes, [Cracked!](link)

... other stuff ...
</code>```

If your submission is safe, format like this:

```<code># Language Name, N bytes, Safe!

... other stuff ...
</code>```

```

答:
Haskell, 99 bytes, Safe

"super.quine?"=>#$$$%%%%%&&(())))**++++,,,,/;<<==>>STaabbdeffggghhhjlmmnoppqqrrsssttttuuuvvwwwwxxxx
```

<p>Another Haskell quine, this time with a nice odd 99 bytes. </p>

<blockquote class="spoiler">
  <p> ```g%w=(g< $ >w)++w++pure(g.last$w);main=putStr$pred%"h&x>)h=%?x*,,x,,qvsf)h/mbtu%x*qvuTus%qsfe&#"```
 Try it on Ideone. The spaces in "g< $ >w" must be removed, I put them there because otherwise the <,$, and > vanish (most likely being interpreted as html tag).
 The gibberish string is a string of the program with each char mapped to it's successor, including a final " (which is possible to include into the string without escaping because it's mapped to #). The helper function % takes the string and maps each char to it's predecessor using pred (yielding code"), then appends the original string (yielding code"gibberish_code) and the last char of the decoded string (yielding code"gibberish_code"). To convert a char c to a string it would normally suffice to put it into a list [c] as strings in Haskell are simply char lists, however the successor of [ is \, which would need escaping in the successor-encoded string, so instead pure is used which lifts arbitrary types into a Monad (which Monad to use is inferred from the context).

Title: Quine Anagrams! (Cops' Thread)

Body:
Haskell, 99 bytes, Safe

"super.quine?"=>#$$$%%%%%&&(())))**++++,,,,/;<<==>>STaabbdeffggghhhjlmmnoppqqrrsssttttuuuvvwwwwxxxx

Another Haskell quine, this time with a nice odd 99 bytes.

g%w=(g< $ >w)++w++pure(g.last$w);main=putStr$pred%"h&x>)h=%?x*,,x,,qvsf)h/mbtu%x*qvuTus%qsfe&#"

 Try it on Ideone. The spaces in "g< $ >w" must be removed, I put them there because otherwise the <,$, and > vanish (most likely being interpreted as html tag).
 The gibberish string is a string of the program with each char mapped to it's successor, including a final " (which is possible to include into the string without escaping because it's mapped to #). The helper function % takes the string and maps each char to it's predecessor using pred (yielding code"), then appends the original string (yielding code"gibberish_code) and the last char of the decoded string (yielding code"gibberish_code"). To convert a char c to a string it would normally suffice to put it into a list [c] as strings in Haskell are simply char lists, however the successor of [ is \, which would need escaping in the successor-encoded string, so instead pure is used which lifts arbitrary types into a Monad (which Monad to use is inferred from the context).


问:
Quine Anagrams! (Robbers' Thread)
This is the robbers' thread. For the cops' thread, click here.

Cops' Task

For the cops' thread, click here.

Robbers' Task

Find an uncracked submission on the cops' thread. (A submission may only be cracked once.)

Unscramble the code to find a working quine.

Post an answer on the robbers' thread. Include the language, the byte count, the user who posted the scrambled code, a link to that answer, and the unscrambled code.

Here is an example of a robber submission:

Python, 29 bytes, Oliver

```<code>_='_=%r;print _%%_';print _%_
</code>```

Scoring

The user with the most cracks will be the winner of this section.

答:
Python 2, 105 bytes, Erik the Golfer

a='a=%r;print a%%a ###(((())))**-01::@@@@@[[]]gggiiirrr~';print a%a ###(((())))**-01::@@@@@[[]]gggiiirrr~
```

It's just the standard Python string formatting quine...

Title: Quine Anagrams! (Robbers' Thread)

Body:
Python 2, 105 bytes, Erik the Golfer

a='a=%r;print a%%a ###(((())))**-01::@@@@@[[]]gggiiirrr~';print a%a ###(((())))**-01::@@@@@[[]]gggiiirrr~

It's just the standard Python string formatting quine...


问:
The Art of Word Shaping

The Art of Word Shaping

Given a binary matrix and a string of letters, replace all 1's in the matrix, moving from top to bottom and from left to right within each row, with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's with spaces. It's probably easier to just give an example or two.

Case: Base case...

Input One:

```<code>[0,0,1,0,0]
[0,1,0,1,0]
[1,0,0,0,1]
[0,1,0,1,0]
[0,0,1,0,0]

"PPCGPPCG"
</code>```

Output One:

```<code>  P
 P C
G   P
 P C
  G
</code>```

Case: If the input string is longer than the number of ones...

Input Two:

```<code>[1,0,0]
[0,1,0]
[1,0,1]

lambda
</code>```

Output Two:

```<code>l
 a
m b
</code>```

Case: If the input string is shorter than the number of ones...

Input Three:

```<code>[1,1,1]
[1,0,1]
[1,1,1]

PPCG
</code>```

Output Three:

```<code>PPC
G P
PCG
</code>```

Available Assumptions

You may assume the input string is never empty.

You may assume the matrix will never be empty.

You may not assume that the binary matrix will never be all zeros.

Rules

If the string is shorter than the number of ones, repeat the string; all ones must be replaced.

If the string is longer than the number of ones, only use what is needed.

You may use True/False in place of integers/bits for the input.

Trailing spaces ARE REQUIRED, all zeros must be replaced with spaces.

A single trailing newline is acceptable.

This is code-golf, lowest byte count wins.

答:
JavaScript ES6, <s>67</s> <s>53</s> <s>50</s> 49 bytes

Saved 3 bytes thanks to @ETHproductions
Saved 1 more thanks to @Neil

```<code>(a,b,i)=>a.replace(/./g,c=>+c?b[++i]||b[i=0]:' ')
</code>```

f=
(a,b,i)=>a.replace(/./g,c=>+c?b[++i]||b[i=0]:' ')

G=_=>h.innerHTML = f(`00100
01010
10001
01010
00100`,z.value)
h.innerHTML = G()```
<pre class="snippet-code-html lang-html prettyprint-override"><code><input id=z oninput="G()" value="PPCG"></input>
<pre id=h></code>```

Old code before I knew that string matrices are a valid input format:

```<code>(a,b)=>a.map(c=>c.map(d=>d?b[i++%b.length]:' ').join``,i=0).join`
`
</code>```

f=
(a,b)=>a.map(c=>c.map(d=>d?b[i++%b.length]:' ').join``,i=0).join`
`

G=_=>h.innerHTML = f([[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0]],z.value)
h.innerHTML = G()```
<pre class="snippet-code-html lang-html prettyprint-override"><code><input id=z oninput="G()" value="PPCG"></input>
<pre id=h></code>```

ContentLicense: CC BY-SA 4.0

Title: The Art of Word Shaping

Body:
JavaScript ES6, <s>67</s> <s>53</s> <s>50</s> 49 bytes

Saved 3 bytes thanks to @ETHproductions
Saved 1 more thanks to @Neil

(a,b,i)=>a.replace(/./g,c=>+c?b[++i]||b[i=0]:' ')

f=
(a,b,i)=>a.replace(/./g,c=>+c?b[++i]||b[i=0]:' ')

G=_=>h.innerHTML = f(`00100
01010
10001
01010
00100`,z.value)
h.innerHTML = G()

<input id=z oninput="G()" value="PPCG"></input>
<pre id=h>

Old code before I knew that string matrices are a valid input format:

(a,b)=>a.map(c=>c.map(d=>d?b[i++%b.length]:' ').join``,i=0).join`
`

f=
(a,b)=>a.map(c=>c.map(d=>d?b[i++%b.length]:' ').join``,i=0).join`
`

G=_=>h.innerHTML = f([[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0]],z.value)
h.innerHTML = G()

<input id=z oninput="G()" value="PPCG"></input>
<pre id=h>


答:
Retina, <s>41</s> 33 bytes

```<code>0

+1`(.)(.*)(\D+)1
$2$1$3$1
A1`
</code>```

Try it online!

The input string is given on the first row of the input, followed by the matrix. Since Retina has no concept of lists (or really anything except strings), there are no separators in the binary matrix except for linefeeds to separate rows.

Explanation

```<code>0

</code>```

Turns zeros into spaces.

```<code>+1`(.)(.*)(\D+)1
$2$1$3$1
</code>```

Repeatedly replace the first 1 with the first character of the input string while also rotating that character to the end of the input string. This takes care cases where there are more 1s than characters in the input string.

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

Discard the first line, i.e. the input string.

Title: The Art of Word Shaping

Body:
The Art of Word Shaping

Given a binary matrix and a string of letters, replace all 1's in the matrix, moving from top to bottom and from left to right within each row, with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's with spaces. It's probably easier to just give an example or two.

Case: Base case...

Input One:

```<code>[0,0,1,0,0]
[0,1,0,1,0]
[1,0,0,0,1]
[0,1,0,1,0]
[0,0,1,0,0]

"PPCGPPCG"
</code>```

Output One:

```<code>  P
 P C
G   P
 P C
  G
</code>```

Case: If the input string is longer than the number of ones...

Input Two:

```<code>[1,0,0]
[0,1,0]
[1,0,1]

lambda
</code>```

Output Two:

```<code>l
 a
m b
</code>```

Case: If the input string is shorter than the number of ones...

Input Three:

```<code>[1,1,1]
[1,0,1]
[1,1,1]

PPCG
</code>```

Output Three:

```<code>PPC
G P
PCG
</code>```

Available Assumptions

You may assume the input string is never empty.

You may assume the matrix will never be empty.

You may not assume that the binary matrix will never be all zeros.

Rules

If the string is shorter than the number of ones, repeat the string; all ones must be replaced.

If the string is longer than the number of ones, only use what is needed.

You may use True/False in place of integers/bits for the input.

Trailing spaces ARE REQUIRED, all zeros must be replaced with spaces.

A single trailing newline is acceptable.

This is code-golf, lowest byte count wins.

Body:
Retina, <s>41</s> 33 bytes

0

+1`(.)(.*)(\D+)1
$2$1$3$1
A1`

Try it online!

The input string is given on the first row of the input, followed by the matrix. Since Retina has no concept of lists (or really anything except strings), there are no separators in the binary matrix except for linefeeds to separate rows.

Explanation

0

Turns zeros into spaces.

+1`(.)(.*)(\D+)1
$2$1$3$1

Repeatedly replace the first 1 with the first character of the input string while also rotating that character to the end of the input string. This takes care cases where there are more 1s than characters in the input string.

A1`

Discard the first line, i.e. the input string.


问:
Walk the words!
It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!

Walking words

Walking words are words which will respond to certain characters. For the purpose of this challenge the trigger characters are [u, d, r, l] from up down right left.

Whenever you encounter such a character when printing text, you will move the direction of the text.

For example, the text abcdef will result in:

```<code>abcd
   e
   f
</code>```

Rules

Both uppercase UDRL and lowercase udrl should change the direction, but case should be preserved in the output

Input will only contain printable characters (0-9, A-Z, a-z, !@#%^&*() etc...), no newlines!

Whenever the text will collide, it will overwrite the old character at that position

Output should be presented to the user in any fashionable matter, but it should be a single output (no array of lines)

Trailing and leading newlines are allowed

Trailing spaces are allowed

Standard loopholes apply

Test cases

```<code>empty input => empty output or a newline

u =>
u

abc =>
abc

abcd =>
abcd

abcde =>
abcd
   e

abcdde =>
abcd
   d
   e

codegolf and programming puzzles =>
   cod
     e
     g
     o
dna fl    sel
            z
p           z
rogramming pu

ABCDELFUGHI =>
 I
AHCD
 G E
 UFL

It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>
dnats taht noinipo el
a                   b
rd                  m
       It is in my hu
 t
 e
 x
 t

 i
 s

 b
 o
 ring. Therefore I propose a new writing stand
                                             a
                                             rd
                                              ,

                                              w
                                              a
                                      rdw gnikl
                                       s
                                       !
</code>```

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

答:
C#, 525 474 Bytes

Edit: Saved 51 Bytes thanks to @steenbergh

It's not pretty, but it does work...

Golfed:

```<code>string W(string s){var l=s.Length;var a=new char[2*l+1,2*l+1];int x=2*l/2;int y=2*l/2;int d=0;for(int i=0;i<l;i++){switch(char.ToUpper(s[i])){case'U':d=3;break;case'D':d=1;break;case'L':d=2;break;case'R':d=0;break;}a[y,x]=s[i];switch(d){case 0:x+=1;break;case 1:y+=1;break;case 2:x-=1;break;case 3:y-=1;break;}}string o="";for(int i=0;i<2*l+1;i++){string t="";for(int j=0;j<2*l+1;j++)t+=a[i,j]+"";o+=t==string.Join("",Enumerable.Repeat('\0',2*l+1))?"":(t+"\r\n");}return o;}
</code>```

Ungolfed:

```<code>public string W(string s)
{
  var l = s.Length;
  var a = new char[2 * l + 1, 2 * l + 1];
  int x = 2 * l / 2;
  int y = 2 * l / 2;
  int d = 0;
  for (int i = 0; i < l; i++)
  {
    switch (char.ToUpper(s[i]))
    {
      case 'U':
        d = 3;
        break;
      case 'D':
        d = 1;
        break;
      case 'L':
        d = 2;
        break;
      case 'R':
        d = 0;
        break;
    }
    a[y, x] = s[i];
    switch (d)
    {
      case 0:
        x += 1;
        break;
      case 1:
        y += 1;
        break;
      case 2:
        x -= 1;
        break;
      case 3:
        y -= 1;
        break;
    }
  }
  string o = "";
  for (int i = 0; i < 2 * l + 1; i++)
  {
    string t = "";
    for (int j = 0; j < 2 * l + 1; j++)
      t += a[i, j] + "";
    o += t == string.Join("", Enumerable.Repeat('\0', 2 * l + 1)) ? "" : (t + "\r\n");
  }
  return o;
}
</code>```

Explanation:

Uses a two-dimensional array and the d value to increment the position of the array in the correction direction, where d values are:

```<code>0 => RIGHT
1 => DOWN
2 => LEFT
3 => UP
</code>```

Test:

```<code>var walkTheWords = new WalkTheWords();
Console.WriteLine(walkTheWords.W("codegolf and programming puzzles"));

                            cod
                              e
                              g
                              o
                         dna fl    sel
                                     z
                         p           z
                         rogramming pu
</code>```

Title: Walk the words!

Body:
C#, 525 474 Bytes

Edit: Saved 51 Bytes thanks to @steenbergh

It's not pretty, but it does work...

Golfed:

string W(string s){var l=s.Length;var a=new char[2*l+1,2*l+1];int x=2*l/2;int y=2*l/2;int d=0;for(int i=0;i<l;i++){switch(char.ToUpper(s[i])){case'U':d=3;break;case'D':d=1;break;case'L':d=2;break;case'R':d=0;break;}a[y,x]=s[i];switch(d){case 0:x+=1;break;case 1:y+=1;break;case 2:x-=1;break;case 3:y-=1;break;}}string o="";for(int i=0;i<2*l+1;i++){string t="";for(int j=0;j<2*l+1;j++)t+=a[i,j]+"";o+=t==string.Join("",Enumerable.Repeat('\0',2*l+1))?"":(t+"\r\n");}return o;}

Ungolfed:

public string W(string s)
{
  var l = s.Length;
  var a = new char[2 * l + 1, 2 * l + 1];
  int x = 2 * l / 2;
  int y = 2 * l / 2;
  int d = 0;
  for (int i = 0; i < l; i++)
  {
    switch (char.ToUpper(s[i]))
    {
      case 'U':
        d = 3;
        break;
      case 'D':
        d = 1;
        break;
      case 'L':
        d = 2;
        break;
      case 'R':
        d = 0;
        break;
    }
    a[y, x] = s[i];
    switch (d)
    {
      case 0:
        x += 1;
        break;
      case 1:
        y += 1;
        break;
      case 2:
        x -= 1;
        break;
      case 3:
        y -= 1;
        break;
    }
  }
  string o = "";
  for (int i = 0; i < 2 * l + 1; i++)
  {
    string t = "";
    for (int j = 0; j < 2 * l + 1; j++)
      t += a[i, j] + "";
    o += t == string.Join("", Enumerable.Repeat('\0', 2 * l + 1)) ? "" : (t + "\r\n");
  }
  return o;
}

Explanation:

Uses a two-dimensional array and the d value to increment the position of the array in the correction direction, where d values are:

0 => RIGHT
1 => DOWN
2 => LEFT
3 => UP

Test:

var walkTheWords = new WalkTheWords();
Console.WriteLine(walkTheWords.W("codegolf and programming puzzles"));

                            cod
                              e
                              g
                              o
                         dna fl    sel
                                     z
                         p           z
                         rogramming pu


答:
MATL, 11 bytes

```<code>yz:)1Gg!(c!
</code>```

Inputs are a numeric matrix (with ; as row separator) and a string.

Try it online! Or verify test cases: 1, 2, 3.

```<code>y       % Take the two inputs implicitly. Duplicate the first
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lambda', [1,0,0; 0,1,0; 1,0,1]
z       % Number of nonzeros
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lambda', 4
:       % Range
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lambda', [1 2 3 4]
)       % Reference indexing (select values)
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lamb'
1Gg     % Push first input as a logical matrix; will be used as index
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lamb', [1,0,0; 0,1,0; 1,0,1]
!       % Transpose. This is necessary because MATL uses column-major order
        % (down, then accross)
(       % Assignment indexing (fill with values). Since the original matrix
        % is numeric, the new values are introduced as their ASCII codes
        % STACK: [108, 0, 109; 0, 97, 0; 1, 0, 98]
c       % Convert to char
        % STACK: ['l m'; ' a '; '  b']
!       % Transpose back. Implicitly display
        % STACK: ['l  '; ' a '; 'm b']
</code>```

Title: The Art of Word Shaping

Body:
MATL, 11 bytes

yz:)1Gg!(c!

Inputs are a numeric matrix (with ; as row separator) and a string.

Try it online! Or verify test cases: 1, 2, 3.

y       % Take the two inputs implicitly. Duplicate the first
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lambda', [1,0,0; 0,1,0; 1,0,1]
z       % Number of nonzeros
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lambda', 4
:       % Range
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lambda', [1 2 3 4]
)       % Reference indexing (select values)
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lamb'
1Gg     % Push first input as a logical matrix; will be used as index
        % STACK: [1,0,0; 0,1,0; 1,0,1], 'lamb', [1,0,0; 0,1,0; 1,0,1]
!       % Transpose. This is necessary because MATL uses column-major order
        % (down, then accross)
(       % Assignment indexing (fill with values). Since the original matrix
        % is numeric, the new values are introduced as their ASCII codes
        % STACK: [108, 0, 109; 0, 97, 0; 1, 0, 98]
c       % Convert to char
        % STACK: ['l m'; ' a '; '  b']
!       % Transpose back. Implicitly display
        % STACK: ['l  '; ' a '; 'm b']


答:
PHP, <s>110</s> <s>91</s> <s>97</s> <s>88</s> <s>82</s> <s>81</s> <s>80</s> 75 bytes

saved 6 bytes thanks to @user59178

```<code>while(""<$c=$argv[1][$i++])echo$c<1?$c?:" ":($s=$argv[2])[$k++%strlen($s)];
</code>```

Run with -r. Expects matrix as multiline string in first argument, string in second argument.

Title: The Art of Word Shaping

Body:
PHP, <s>110</s> <s>91</s> <s>97</s> <s>88</s> <s>82</s> <s>81</s> <s>80</s> 75 bytes

saved 6 bytes thanks to @user59178

while(""<$c=$argv[1][$i++])echo$c<1?$c?:" ":($s=$argv[2])[$k++%strlen($s)];

Run with -r. Expects matrix as multiline string in first argument, string in second argument.


答:
Perl, 40 bytes

36 bytes of code + -i -p flags.

@F=$^I=~/./g;s/1/$F[$i++%@F]/g;y;0;
```

<p>(note the final space and the lack of final newline).</p>

<p>To run it, write the input string after <code>-i</code> flag, and supply the matrix in the input :</p>

```perl -iPPCGPPCG -pe '@F=$^I=~/./g;s/1/$F[$i++%@F]/g;y;0; ' <<< "00100
01010
10001
01010
00100"
```

If your Perl is a bit old, you might need to add a final semicolon (after the space).

Title: The Art of Word Shaping

Body:
Perl, 40 bytes

36 bytes of code + -i -p flags.

@F=$^I=~/./g;s/1/$F[$i++%@F]/g;y;0;

(note the final space and the lack of final newline).

To run it, write the input string after -i flag, and supply the matrix in the input :

perl -iPPCGPPCG -pe '@F=$^I=~/./g;s/1/$F[$i++%@F]/g;y;0; ' <<< "00100
01010
10001
01010
00100"

If your Perl is a bit old, you might need to add a final semicolon (after the space).


问:
Draw diagonal lines of text
Given an input of a list of words, output the words with their letters arranged
diagonally:

```<code>p
 r
  o
p  g
 u  r
  z  a
a  z  m
 n  l  m
  d  e  i
c     s  n
 o        g
  d
g  e
 o
  l
   f
</code>```

(The above should be the output for the input programming puzzles and code golf.)

To be precise, each word starts on the first column and three rows below the
previous word, and each successive letter moves one column to the right and one
row down.

The input may be provided as either a single string of words, separated by
exactly one space, or a list/array of words. The words will only be composed of
lowercase letters, a-z, and will always be at least one character long.

The output may be a single string, an array of lines, or an array of arrays of
characters. Leading or trailing whitespace is not allowed, except for a single
trailing newline.

Further test cases:

a bcd efgh i j

```<code>a

b
 c
  d
e
 f
  g
i  h

j
</code>```

x

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

verylongword short

```<code>v
 e
  r
s  y
 h  l
  o  o
   r  n
    t  g
        w
         o
          r
           d
</code>```

Since this is code-golf, the shortest code in bytes will win!

答:
Python 2, 146 bytes

```<code>s=input()
k=max(map(len,s))
a=[k*[' ']for x in range(k+len(s)*3+3)]
for x in range(len(s)):
 for y in range(len(s[x])):a[x*3+y][y]=s[x][y]
print a
</code>```

Note: the indentations for the last two lines are <space> and <tab>, which saves one byte since I don't need to double-indent.

Input is to be entered as an array of strings like so: ["hello", "world"] or ['hello', 'world']. Output is an array of arrays of characters.

There's probably a better way to do this...

EDIT Thanks to Doorknob for pointing out a missing close square bracket. I placed it before the *k... in the third line.

Title: Draw diagonal lines of text

Body:
Python 2, 146 bytes

s=input()
k=max(map(len,s))
a=[k*[' ']for x in range(k+len(s)*3+3)]
for x in range(len(s)):
 for y in range(len(s[x])):a[x*3+y][y]=s[x][y]
print a

Note: the indentations for the last two lines are <space> and <tab>, which saves one byte since I don't need to double-indent.

Input is to be entered as an array of strings like so: ["hello", "world"] or ['hello', 'world']. Output is an array of arrays of characters.

There's probably a better way to do this...

EDIT Thanks to Doorknob for pointing out a missing close square bracket. I placed it before the *k... in the third line.


问:
Code ladder, Robbers
This is the robbers' thread. The cops' thread goes here.

Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce 1 in its initial state, and produce the numbers 2, 3 .. when single alterations are made.

The winner will be the robber that cracked the most posts.

Example post:

MyLang, 9 bytes, 8 numbers (including link to answer), Cop's username.

Original code:

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

Code that produces 1 - 8:

```<code>1: abc1efghi
2: abc2efghi
3: abc2efghij
4: kbc2efghij
5: kbc23fghij
6: kbc23fghi
7: kbc63fghi
8: kbc63fhi
</code>```

Explanations are encouraged. The exact format of the robber post is optional.

答:
JavaScript, 22 bytes, 10 numbers by Arnauld

Original code:

alert(__14_337__xc_de)
```

<p><strong>Modified</strong>:</p>

<pre class="lang-js prettyprint-override"><code>alert(00140337-0xc0de) // 1
alert(00140337-0xc0dd) // 2
alert(00140337-0xc0dc) // 3
alert(00140337-0xc0db) // 4
alert(00140337-0xc0da) // 5
alert(00140337-0xc0d9) // 6
alert(00140337-0xc0d8) // 7
alert(00140337-0xc0d7) // 8
alert(00140337-0xc0d6) // 9
alert(00140337-0xc0d5) // 10
</code>```

I'm guessing this isn't the intended solution, but I'm hoping it's not too far off...

Title: Code ladder, Robbers

Body:
JavaScript, 22 bytes, 10 numbers by Arnauld

Original code:

alert(__14_337__xc_de)

Modified:

alert(00140337-0xc0de) // 1
alert(00140337-0xc0dd) // 2
alert(00140337-0xc0dc) // 3
alert(00140337-0xc0db) // 4
alert(00140337-0xc0da) // 5
alert(00140337-0xc0d9) // 6
alert(00140337-0xc0d8) // 7
alert(00140337-0xc0d7) // 8
alert(00140337-0xc0d6) // 9
alert(00140337-0xc0d5) // 10

I'm guessing this isn't the intended solution, but I'm hoping it's not too far off...


答:
Perl, 12 bytes, 10 numbers, by ais523

Original code:

```<code>____;say__-9
</code>```

Code that produces 1 - 10:

```<code>wait;say$!-9
wait;say$!-8
wait;say$!-7
wait;say$!-6
wait;say$!-5
wait;say$!-4
wait;say$!-3
wait;say$!-2
wait;say$!-1
wait;say$!-0
</code>```

Explanation:

```<code>wait;         # waits for a child process to end (there is no child so it just returns)
     say      # put the following on the screen:
        $!    # current value of the C errno. In this case, ECHILD (No child processes)
              # which has a value of 10
          -9  # minus 9
</code>```

Title: Code ladder, Robbers

Body:
This is the robbers' thread. The cops' thread goes here.

Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce 1 in its initial state, and produce the numbers 2, 3 .. when single alterations are made.

The winner will be the robber that cracked the most posts.

Example post:

MyLang, 9 bytes, 8 numbers (including link to answer), Cop's username.

Original code:

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

Code that produces 1 - 8:

```<code>1: abc1efghi
2: abc2efghi
3: abc2efghij
4: kbc2efghij
5: kbc23fghij
6: kbc23fghi
7: kbc63fghi
8: kbc63fhi
</code>```

Explanations are encouraged. The exact format of the robber post is optional.

Body:
Perl, 12 bytes, 10 numbers, by ais523

Original code:

____;say__-9

Code that produces 1 - 10:

wait;say$!-9
wait;say$!-8
wait;say$!-7
wait;say$!-6
wait;say$!-5
wait;say$!-4
wait;say$!-3
wait;say$!-2
wait;say$!-1
wait;say$!-0

Explanation:

wait;         # waits for a child process to end (there is no child so it just returns)
     say      # put the following on the screen:
        $!    # current value of the C errno. In this case, ECHILD (No child processes)
              # which has a value of 10
          -9  # minus 9


问:
Code ladder, Cops

Note: This challenge is finished. Submissions are still welcome but can not win.

This is the cops' thread. The robbers' thread goes here.

Write a code that outputs the integer 1. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2. Change one more character (the same or another), and the code should output 3. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1 are accepted. You can ignore output to STDERR (or equivalent).

You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.

Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.

Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).

Example post:

The following post is a submission in the language MyLang, it is 9 bytes long, and it works for numbers 1 - 8.

MyLang, 9 bytes, 8 numbers

This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _.

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

Leaderboard

Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.

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

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

答:
><> Fish 5 bytes 10 numbers Cracked by Emigna

```<code>_2__;
</code>```

It should be easy to guess but I threw in a little curve ball to make it slightly harder.

Title: Code ladder, Cops

Body:
><> Fish 5 bytes 10 numbers Cracked by Emigna

_2__;

It should be easy to guess but I threw in a little curve ball to make it slightly harder.


问:
Iterated partial sums
The partial sums of a list of integers [a1, a2, a3, ..., an] are

s1 = a1

s2 = a1 + a2

s3 = a1 + a2 + a3

...

sn = a1 + a2 + ... + an

We can then take the list of partial sums [s1, s2, s3, ..., sn] and compute its partial sums again to produce a new list, and so on.

Related: Iterated forward differences

Input:

A non-empty list of integers

A positive number of iterations,

Output: Print or return the list of integers that results from taking the partial sums that many times.

Fewest bytes wins. Built-ins are OK even if they outright solve the problem.

Test cases:

```<code>f([-3, 4, 7, -1, 15], 1) == [-3, 1, 8, 7, 22]
f([-3, 4, 7, -1, 15], 3) == [-3, -5, 1, 14, 49]
</code>```

Leaderboard:

var QUESTION_ID=59192,OVERRIDE_USER=20260;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/61321/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

```

答:
05AB1E, 4 bytes

```<code>F.pO
</code>```

Explanation

```<code>F    # Implicitly take first input and loop n times.
 .p  # Generate prefixes of input.
   O # Sum all prefixes (implicitly vectorized).
</code>```

Try it online!

Title: Iterated partial sums

Body:
05AB1E, 4 bytes

F.pO

Explanation

F    # Implicitly take first input and loop n times.
 .p  # Generate prefixes of input.
   O # Sum all prefixes (implicitly vectorized).

Try it online!


Title: Code ladder, Robbers

Body:
><>, 5 bytes, 10 numbers, Teal pelican

>21n;
>22n;
>23n;
>24n;
>25n;
>26n;
>27n;
>28n;
>29n;
>2an;


答:
Perl, 204 + 3 = 207 bytes

+3 for -F

Whitespace is not part of the code and is provided for legibility.

```<code>%p=(d,1,l,2,u,3,r,$x=$y=0);
for(@F){
    $m{"$x,$y"}=$_;
    $g=$p{lc$_}if/[dlur]/i;
    $g%2?($y+=2-$g):($x+=1-$g);
    ($a>$x?$a:$b<$x?$b:$x)=$x;
    ($c>$y?$c:$d<$y?$d:$y)=$y
}
for$k($c..$d){
    print($m{"$_,$k"}||$")for$a..$b;
    say""
}
</code>```

Similar to my solution to the Fizz Buzz challenge, I create a hash with x,y coordinates for every step along the way, keeping the maximums and minimums of the x- and y- coordinates stored, then loop through and print everything out.

If I'm desperate I might be able to turn the last three lines of the first for loop into a single disgusting statement that may save a byte or two, but I'm not looking forward to the completely unreadable result.

Title: Walk the words!

Body:
It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words!

Walking words

Walking words are words which will respond to certain characters. For the purpose of this challenge the trigger characters are [u, d, r, l] from up down right left.

Whenever you encounter such a character when printing text, you will move the direction of the text.

For example, the text abcdef will result in:

```<code>abcd
   e
   f
</code>```

Rules

Both uppercase UDRL and lowercase udrl should change the direction, but case should be preserved in the output

Input will only contain printable characters (0-9, A-Z, a-z, !@#%^&*() etc...), no newlines!

Whenever the text will collide, it will overwrite the old character at that position

Output should be presented to the user in any fashionable matter, but it should be a single output (no array of lines)

Trailing and leading newlines are allowed

Trailing spaces are allowed

Standard loopholes apply

Test cases

```<code>empty input => empty output or a newline

u =>
u

abc =>
abc

abcd =>
abcd

abcde =>
abcd
   e

abcdde =>
abcd
   d
   e

codegolf and programming puzzles =>
   cod
     e
     g
     o
dna fl    sel
            z
p           z
rogramming pu

ABCDELFUGHI =>
 I
AHCD
 G E
 UFL

It is in my humble opinion that standard text is boring. Therefore I propose a new writing standard, walking words! =>
dnats taht noinipo el
a                   b
rd                  m
       It is in my hu
 t
 e
 x
 t

 i
 s

 b
 o
 ring. Therefore I propose a new writing stand
                                             a
                                             rd
                                              ,

                                              w
                                              a
                                      rdw gnikl
                                       s
                                       !
</code>```

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

Body:
Perl, 204 + 3 = 207 bytes

+3 for -F

Whitespace is not part of the code and is provided for legibility.

%p=(d,1,l,2,u,3,r,$x=$y=0);
for(@F){
    $m{"$x,$y"}=$_;
    $g=$p{lc$_}if/[dlur]/i;
    $g%2?($y+=2-$g):($x+=1-$g);
    ($a>$x?$a:$b<$x?$b:$x)=$x;
    ($c>$y?$c:$d<$y?$d:$y)=$y
}
for$k($c..$d){
    print($m{"$_,$k"}||$")for$a..$b;
    say""
}

Similar to my solution to the Fizz Buzz challenge, I create a hash with x,y coordinates for every step along the way, keeping the maximums and minimums of the x- and y- coordinates stored, then loop through and print everything out.

If I'm desperate I might be able to turn the last three lines of the first for loop into a single disgusting statement that may save a byte or two, but I'm not looking forward to the completely unreadable result.


答:
Pyth, 12 bytes

```<code>jms?R@z~hZ\
</code>```

Try it online: Demonstration

Explanation:

```<code>jms?R@z~hZ\ dQ   implicit d and Q at the end
                 I use the variable Z, which is initialized with 0 by default
 m           Q   map each line d of the Q (input matrix) to:
   ?R       d       map each number d of the line either to
     @z~hZ             input[Z++] (increase Z, but lookup in input string with old value)
          \            or space
  s                 join chars to a string
j                print each string on a separate line
</code>```

Title: The Art of Word Shaping

Body:
Pyth, 12 bytes

jms?R@z~hZ\

Try it online: Demonstration

Explanation:

jms?R@z~hZ\ dQ   implicit d and Q at the end
                 I use the variable Z, which is initialized with 0 by default
 m           Q   map each line d of the Q (input matrix) to:
   ?R       d       map each number d of the line either to
     @z~hZ             input[Z++] (increase Z, but lookup in input string with old value)
          \            or space
  s                 join chars to a string
j                print each string on a separate line


答:
Vim, <s>44</s> 42 bytes

```<code>qqy$P0xjf1"_xP{@qq@q:s/0/ /g^M:s/,/^V^M/g^M{D
</code>```

Saved 2 bytes thanks to @DjMcMoylex!

Here, the ^M is a literal newline, and the ^V is CTRL-V

Takes the input in this format:

```<code>PPCG
00100,01010,10001,01010,00100
</code>```

Disclaimer: If the string is longer than ~40 chars long, your computer might run out of ram.

Explanation:

```<code>qq             @qq@q                            # Start recording a recursive macro.
  y$P0x                                         # Duplicate the string and cut out the first character
       jf1"_xP{                                 # Find the first 1, and replace it with the cut character from the string.
                                                # Now we have replaced all the 1's with their respective character, but we still have the array in the original format, and we have the string massivly duplicated at the first line, so we need to clean it up:
                    :s/0/ /g^M                  # Replace all 0's with a space
                              :s/,/^V^M/g^M     # Replace all ,'s with a newline. The ^V acts like a backslash, it escapes the newline so that the command isn't run too soon
                                           {D   # Delete the first line
</code>```

Here's a gif of me "running" the "program":

Title: The Art of Word Shaping

Body:
Vim, <s>44</s> 42 bytes

qqy$P0xjf1"_xP{@qq@q:s/0/ /g^M:s/,/^V^M/g^M{D

Saved 2 bytes thanks to @DjMcMoylex!

Here, the ^M is a literal newline, and the ^V is CTRL-V

Takes the input in this format:

PPCG
00100,01010,10001,01010,00100

Disclaimer: If the string is longer than ~40 chars long, your computer might run out of ram.

Explanation:

qq             @qq@q                            # Start recording a recursive macro.
  y$P0x                                         # Duplicate the string and cut out the first character
       jf1"_xP{                                 # Find the first 1, and replace it with the cut character from the string.
                                                # Now we have replaced all the 1's with their respective character, but we still have the array in the original format, and we have the string massivly duplicated at the first line, so we need to clean it up:
                    :s/0/ /g^M                  # Replace all 0's with a space
                              :s/,/^V^M/g^M     # Replace all ,'s with a newline. The ^V acts like a backslash, it escapes the newline so that the command isn't run too soon
                                           {D   # Delete the first line

Here's a gif of me "running" the "program":


问:
Add weight to one side of a see-saw to balance it

Balancing Act

A see-saw (supposedly from the French 'ci-ça', meaning 'this-that') forms a third of the holy trinity of playground equipment, along with the similarly ubiquitous slide and swing. A see-saw is in perfect balance if, and only if, the sum of the moments on each side are equivalent. A see-saw can therefore be balanced by adding a specific quantity of weight to the side with the lower moment sum; achieving this is your goal for this challenge.

Challenge

Your challenge is to take a depiction of a see-saw as input and output it again, with weight added to one end of the see-saw to balance it.

Input

Your program must take, in any reasonable format, an ASCII see-saw such as the following:

```<code>100             100
-------------------
         ^
</code>```

The first line contains two numbers, each representing weights on the see-saw. Exactly one weight is present on each side, each acting on the very end of its side of the plank. Weights are guaranteed to be integers, and always align with their corresponding end of the plank. These numbers will never overlap the fulcrum (^).

The second line represents the 'plank' of the see-saw. Each dash (-) represents an equal length to each other dash, with the sole exception of the dash directly over the fulcrum (^), which has no length.

The third line represents the fulcrum of the see-saw. This fulcrum is marked by the only character that is not a space on this line, a circumflex ('^'). The fulcrum can be positioned anywhere along the length of the plank in a valid input so long as enough space is left so that the numbers representing weights do not overlap the fulcrum in either the input or the output.

The input is guaranteed to have three lines, and have no white-space prior to or after the characters that constitute the see-saw (excepting, of course, the third line, which requires it).

Output

For output, the same see-saw depiction should be printed to stdout, but with one (and only one) of the weights replaced with a larger weight, so as to balance the see-saw. Inputs are guaranteed to make this possible using integers alone. Therefore, weights must be shown without decimal points or any other similar notations. If your language does not use stdout you should go by community / meta consensus on output. Trailing newlines are fine but any other changes to the depiction format are probably not OK.

Exemplification

Test Inputs and Corresponding Outputs

Input 1

```<code>12                22
--------------------
             ^
</code>```

Output 1

```<code>12                26
--------------------
             ^
</code>```

Input 2

```<code>42       42
-----------
     ^
</code>```

Output 2

```<code>42       42
-----------
     ^
</code>```

Input 3

```<code>3             16
----------------
        ^
</code>```

Output 3

```<code>14            16
----------------
        ^
</code>```

Input 4

```<code>1                56
-------------------
    ^
</code>```

Output 4

```<code>196              56
-------------------
    ^
</code>```

Reference Implementation - Python 3

```<code># Takes a list of strings as input
def balance_seesaw(lines):
    weights = [int(w.strip()) for w in lines[0].split()]

    length  = len(lines[1])
    pivot   = lines[2].find("^")
    left_length    = pivot
    right_length   = length - 1 - pivot

    left_torque  = weights[0] * left_length
    right_torque = weights[1] * right_length

    if left_torque > right_torque:
        weights[1] = left_torque // right_length
    elif right_torque > left_torque:
        weights[0] = right_torque // left_length

    weights = [str(w) for w in weights]

    string_gap = " " * (length - sum(len(w) for w in weights))
    lines[0] = weights[0] + string_gap + weights[1]

    print("\n".join(lines))

balance_seesaw(["1                56",
                "-------------------",
                "    ^              "])
</code>```

Rules

This is code-golf, so the shortest code wins counted in bytes. Check meta if counting bytes is awkward in your language.

Standard rules/loopholes apply.

Input must be taken in a reasonable format. A non-exhaustive list of appropriate formats are given as follows:

A single string with lines separated by newline characters

A list of strings, each string represented a line

A 2D Array or Matrix of characters

Related Challenges

Balance a set of weights on a see-saw - Proposed Aug 2015 by samgak

答:
Python 3, 235 230 bytes (minimized reference)

I just minimized the reference, since I'm very new to code-golfing.

```<code>def s(l):
 w,i,t=[int(z.strip())for z in l[0].split()],len(l[1]),l[2].find("^");k,o=i-1-t,w[0]*t;p=w[1]*k
 if o>p:w[1]=o//k
 else:w[0]=p//t
 w=[str(z)for z in w];s=" "*(i-sum(len(z)for z in w));l[0]=w[0]+s+w[1];print("\n".join(l))
</code>```

You use it exactly the same as the example, but the function is s instead of balance_seesaw.

Body:
Python 3, 235 230 bytes (minimized reference)

I just minimized the reference, since I'm very new to code-golfing.

def s(l):
 w,i,t=[int(z.strip())for z in l[0].split()],len(l[1]),l[2].find("^");k,o=i-1-t,w[0]*t;p=w[1]*k
 if o>p:w[1]=o//k
 else:w[0]=p//t
 w=[str(z)for z in w];s=" "*(i-sum(len(z)for z in w));l[0]=w[0]+s+w[1];print("\n".join(l))

You use it exactly the same as the example, but the function is s instead of balance_seesaw.


问:
GO OUT AND VOTE
Today is November 8th, 2016, Election Day in the United States of America.

If you are a U.S. citizen eligible to vote, then go out and vote if you haven't already before answering this challenge. Do not discuss who you voted for. It only matters that you voted.

If you are not a U.S. citizen or not eligible to vote, then, before answering this challenge, do the U.S. a favor by telling anyone you know who is an eligible citizen to go out and vote if they haven't already.

Challenge

Write a program that indicates that you voted, like a digital "I Voted" sticker.

It should take no input and must output in a reasonable way the phrase I Voted where the I, o, and e are red (#FF0000) and the V, t, and d are blue (#0000FF). The background must be white (#FFFFFF).

For example:

These colors are of course representative of the American flag (though not the official colors). Red comes first simply because it comes first in the common idiom "red white and blue".

To be valid, an answer must:

Use the colors specified in the arrangement specified.

Use a single legible font and font size. The example uses 72pt Times New Roman bold but any common font above 6pt is probably fine.

Have just the phrase I Voted on a single line, capitalized correctly, with a clear space between the two words. It shouldn't look like IVoted.

Not indicate who the answerer voted for or supports for president or any down-ballot races. Let's not start any internet debates. This is about celebrating voting, not candidates.

Any reasonable way of displaying or producing the output is valid, such as:

Drawing the text to an image that is then displayed, saved, or output raw.

Writing the text to a console using color formatting. In this case you may approximate pure red and blue if necessary, and it's ok if only the area directly behind the text can be made white.

Displaying the text on a WPF/Windows form.

Outputting an HTML/RTF/PDF file with the text.

Please post an image of your output.

The shortest answer in bytes wins.

答:
x86 machine code + DOS + BIOS, 25 bytes

Hexdump:

```<code>b8 02 13 b1 07 bd 0b 01 cd 10 c3 49 74 20 74 56
71 6f 74 74 71 65 74 64 71
</code>```

Assembly code (suitable as input to debug.com, so all numbers are hexadecimal):

```<code>mov ax, 1302
mov cl, 7
mov bp, 10b
int 10
ret
db 'It tVqottqetdq'
</code>```

It uses a BIOS routine to output the string to the display memory. The string will appear at a "random" position on screen (see below), like this:

The string contains the letters I   V o t e d, interleaved with "attributes"

```<code>74 74 71 74 71 74 71
</code>```

that specify the colour of the letters. Here 7 as the most significant digit means "white background", and the least significant digit specifies the foreground (1=blue; 4=red).

The display position of the string is specified by the dx register. As mentioned here, the initial value of this register is equal to the value of the cs register. And the value of that one is the first available address in memory, after DOS is loaded.

The size of DOS is typically less than 64K, that is, the segment address of the loaded user's program is less than hexadecimal 1000. So the output will appear somewhere around the first 16 lines of text on the display. In my example, it appeared at line 8 (the upper half of dx, called dh, is equal to 8).

The low half of dx, called dl, contains the column at which the text is output. Experiments show that BIOS doesn't check overflow, so it doesn't matter
if dx asks for output at e.g. column 100.

Title: GO OUT AND VOTE

Body:
x86 machine code + DOS + BIOS, 25 bytes

Hexdump:

b8 02 13 b1 07 bd 0b 01 cd 10 c3 49 74 20 74 56
71 6f 74 74 71 65 74 64 71

Assembly code (suitable as input to debug.com, so all numbers are hexadecimal):

mov ax, 1302
mov cl, 7
mov bp, 10b
int 10
ret
db 'It tVqottqetdq'

It uses a BIOS routine to output the string to the display memory. The string will appear at a "random" position on screen (see below), like this:

The string contains the letters I   V o t e d, interleaved with "attributes"

74 74 71 74 71 74 71

that specify the colour of the letters. Here 7 as the most significant digit means "white background", and the least significant digit specifies the foreground (1=blue; 4=red).

The display position of the string is specified by the dx register. As mentioned here, the initial value of this register is equal to the value of the cs register. And the value of that one is the first available address in memory, after DOS is loaded.

The size of DOS is typically less than 64K, that is, the segment address of the loaded user's program is less than hexadecimal 1000. So the output will appear somewhere around the first 16 lines of text on the display. In my example, it appeared at line 8 (the upper half of dx, called dh, is equal to 8).

The low half of dx, called dl, contains the column at which the text is output. Experiments show that BIOS doesn't check overflow, so it doesn't matter
if dx asks for output at e.g. column 100.


答:
JavaScript, 1574 bytes, Safe!

I spent way too much time on this. Behold the obfuscation.

```<code>(notice that an unmatch parenthesis remains throughout the entire text.

dear "sir",

|    i cannot express my loathing to you and your things. they truly are a loathsome sight. (regar'less of their quality, they function as the most appalling devices...)[1]

|    these avocads of thine possession are most unpleasent. (ce n'est pas faux.) Queer; Careful; An' in total repulsing. in this form, those are not seulement cringe... So; CAB's is quite Cruel. (Cruel indeed...)

|    intention is not great (heh, intention, ;}) run, no, run, since {tu est le ;AqC;};

{{{{============================================}}}}

[1]: see? am i not insane? You may dictate the opposite, so i dictate thus.

9 + 4 is 13. Y is this. Y + 4 is 9 + 9 minus one. N is this. f(x) is {x + x}, so f(N) is N plus N is N + N is 3.

:^) i'm cruel; not so cruel.)
                                  rrrrrrrrrr 0nnnccnnggrrrrttssBBC
{({[}(<[<))(((((){{})}[}][[]{}(]))))|} f f r 0nnnccnngrrrrrttesBBA
())(((()))))()))()()()((((()))}{{})((} f f r 0nnnccnngrrrrrttesBBY
]]}(([][]{{{}}})()({}(){}{()}{}()[])][ f f r 4nnnccnngrrrrrttesBSY
))({})(}{)({{{{(()))())))))))()))()()( f f r 4nnnccnngrrrrrtpesqSY
)()()((((((((((Z))))))))()(()((()((((( f f r 5nnnccnngrrrrrtlefoSY
(((;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''' f f r 3nnncccngrrrrxtleifSY
''''''''''''''''''',,,,,,,,[[[[[[]]]]] f f r 3nnncccngrrrrxtleifZQ
[ ] ] + + + + + + + + + + + + + + + ++ f f r 9nnncccggrrrrxtleifZQ
+ + + + too not fun...fffffffffffffuuu f f r 5nnncccggrrrrxtlli0ZQ
uuuuuuuuuuuu.. | | | |99S            ) f f r 0nnncccggrrrrxxll01QQ
</code>```

Here's the original source!

```<code>function Y(x){return x.charCodeAt()};
function Q(x){return String.fromCharCode(x)};
N=Array.prototype;
function B(f,g,h){return function(){
  return f(g.apply(h||this,arguments));
}};
function S(f,h){return function(){
  return f.apply(h||this,N.reverse.call(arguments))}}
function id(x){return x};
function format(){
  args = N.slice.call(arguments);
  str = args.shift(); res = []+[];
  for(i = 0; i < str.length; i++){
    c = function(){return str[i]};
    if(B(Y,c) == 95){
      res += args.shift();
    } else if(S(B)(c,Y)() == 94){
      res += q = B(id,Q)(34);
      res += args.shift();
      res += q;
    } else if(Y(c()) == 39){
      i++;
      res += c() == ([][0]+[])[1] ? Q(10) : []+[];
    } else res += c();
  }
  return res;
}
console.log(format(Z="function Y(x){return x.charCodeAt()};'nfunction Q(x){return String.fromCharCode(x)};'nN=Array.prototype;'nfunction B(f,g,h){return function(){'n  return f(g.apply(h||this,arguments));'n}};'nfunction S(f,h){return function(){'n  return f.apply(h||this,N.reverse.call(arguments))}}'nfunction id(x){return x};'nfunction format(){'n  args = N.slice.call(arguments);'n  str = args.shift(); res = []+[];'n  for(i = 0; i < str.length; i++){'n    c = function(){return str[i]};'n    if(B(Y,c) == 95){'n      res += args.shift();'n    } else if(S(B)(c,Y)() == 94){'n      res += q = B(id,Q)(34);'n      res += args.shift();'n      res += q;'n    } else if(Y(c()) == 39){'n      i++;'n      res += c() == ([][0]+[])[1] ? Q(10) : []+[];'n    } else res += c();'n  }'n  return res;'n}'nconsole.log(format(Z=^,Z))",Z))</code>```

Title: Quine Anagrams! (Cops' Thread)

Body:
This is the cops' thread. For the robbers' thread, click here.

Cops' Task

First, write a quine in a language of your choosing.

Next, scramble the quine. Make sure to do this well as the robbers will be trying to unscramble it and find the original source code! Note that the scrambled code does not need to work.

Post an answer on this thread. Include the language, the byte count, and the scrambled code.

Your program may not print to STDERR.

Here is an example of a cop submission:

Python, 29 bytes

```<code>nt _%=_r;_riinp;pr_='t _%%%_'
</code>```

Robbers' Task

For the robbers' thread, click here.

Safe Submissions

If your submission has not yet been cracked after a week of posting, you may add the solution and specify that it is safe. If you do not, your submission may still be cracked.

Scoring

This is code-golf, so the user with the safe submission with the fewest bytes will be the winner of this section.

Leaderboard

Here is a stack snippet to generate a learderboard for this challenge. For it to display properly, please format your submission like this:

```<code># Language Name, N bytes

... other stuff ...
</code>```

If your submission gets cracked, please format like this:

```<code># Language Name, N bytes, [Cracked!](link)

... other stuff ...
</code>```

If your submission is safe, format like this:

```<code># Language Name, N bytes, Safe!

... other stuff ...
</code>```

```

Body:
JavaScript, 1574 bytes, Safe!

I spent way too much time on this. Behold the obfuscation.

(notice that an unmatch parenthesis remains throughout the entire text.

dear "sir",

|    i cannot express my loathing to you and your things. they truly are a loathsome sight. (regar'less of their quality, they function as the most appalling devices...)[1]

|    these avocads of thine possession are most unpleasent. (ce n'est pas faux.) Queer; Careful; An' in total repulsing. in this form, those are not seulement cringe... So; CAB's is quite Cruel. (Cruel indeed...)

|    intention is not great (heh, intention, ;}) run, no, run, since {tu est le ;AqC;};

{{{{============================================}}}}

[1]: see? am i not insane? You may dictate the opposite, so i dictate thus.

9 + 4 is 13. Y is this. Y + 4 is 9 + 9 minus one. N is this. f(x) is {x + x}, so f(N) is N plus N is N + N is 3.

:^) i'm cruel; not so cruel.)
                                  rrrrrrrrrr 0nnnccnnggrrrrttssBBC
{({[}(<[<))(((((){{})}[}][[]{}(]))))|} f f r 0nnnccnngrrrrrttesBBA
())(((()))))()))()()()((((()))}{{})((} f f r 0nnnccnngrrrrrttesBBY
]]}(([][]{{{}}})()({}(){}{()}{}()[])][ f f r 4nnnccnngrrrrrttesBSY
))({})(}{)({{{{(()))())))))))()))()()( f f r 4nnnccnngrrrrrtpesqSY
)()()((((((((((Z))))))))()(()((()((((( f f r 5nnnccnngrrrrrtlefoSY
(((;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''' f f r 3nnncccngrrrrxtleifSY
''''''''''''''''''',,,,,,,,[[[[[[]]]]] f f r 3nnncccngrrrrxtleifZQ
[ ] ] + + + + + + + + + + + + + + + ++ f f r 9nnncccggrrrrxtleifZQ
+ + + + too not fun...fffffffffffffuuu f f r 5nnncccggrrrrxtlli0ZQ
uuuuuuuuuuuu.. | | | |99S            ) f f r 0nnncccggrrrrxxll01QQ

Here's the original source!

function Y(x){return x.charCodeAt()};
function Q(x){return String.fromCharCode(x)};
N=Array.prototype;
function B(f,g,h){return function(){
  return f(g.apply(h||this,arguments));
}};
function S(f,h){return function(){
  return f.apply(h||this,N.reverse.call(arguments))}}
function id(x){return x};
function format(){
  args = N.slice.call(arguments);
  str = args.shift(); res = []+[];
  for(i = 0; i < str.length; i++){
    c = function(){return str[i]};
    if(B(Y,c) == 95){
      res += args.shift();
    } else if(S(B)(c,Y)() == 94){
      res += q = B(id,Q)(34);
      res += args.shift();
      res += q;
    } else if(Y(c()) == 39){
      i++;
      res += c() == ([][0]+[])[1] ? Q(10) : []+[];
    } else res += c();
  }
  return res;
}
console.log(format(Z="function Y(x){return x.charCodeAt()};'nfunction Q(x){return String.fromCharCode(x)};'nN=Array.prototype;'nfunction B(f,g,h){return function(){'n  return f(g.apply(h||this,arguments));'n}};'nfunction S(f,h){return function(){'n  return f.apply(h||this,N.reverse.call(arguments))}}'nfunction id(x){return x};'nfunction format(){'n  args = N.slice.call(arguments);'n  str = args.shift(); res = []+[];'n  for(i = 0; i < str.length; i++){'n    c = function(){return str[i]};'n    if(B(Y,c) == 95){'n      res += args.shift();'n    } else if(S(B)(c,Y)() == 94){'n      res += q = B(id,Q)(34);'n      res += args.shift();'n      res += q;'n    } else if(Y(c()) == 39){'n      i++;'n      res += c() == ([][0]+[])[1] ? Q(10) : []+[];'n    } else res += c();'n  }'n  return res;'n}'nconsole.log(format(Z=^,Z))",Z))


答:
Hexagony, 7 bytes, 10 numbers, Cracked

```<code>1<@|!__
</code>```

Works for 1 to 10, _ are hidden characters. I hope I didn't overlook any cheap way to work around the intended solution (I'm looking forward to clever ways to work around the intended solution ;)).

You can try Hexagony online over here.

Title: Code ladder, Cops

Body:
Note: This challenge is finished. Submissions are still welcome but can not win.

This is the cops' thread. The robbers' thread goes here.

Write a code that outputs the integer 1. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2. Change one more character (the same or another), and the code should output 3. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1 are accepted. You can ignore output to STDERR (or equivalent).

You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.

Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.

Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).

Example post:

The following post is a submission in the language MyLang, it is 9 bytes long, and it works for numbers 1 - 8.

MyLang, 9 bytes, 8 numbers

This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _.

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

Leaderboard

Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.

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

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Body:
Hexagony, 7 bytes, 10 numbers, Cracked

1<@|!__

Works for 1 to 10, _ are hidden characters. I hope I didn't overlook any cheap way to work around the intended solution (I'm looking forward to clever ways to work around the intended solution ;)).

You can try Hexagony online over here.


答:
Ruby, 59 bytes

```<code>->a{a.map{|h|a.max.size>13?h.min||26:h.size+12*h.count(0)}}
</code>```

Or, alternatively,

```<code>->a{a.map{|h|a.count([])>2?h.min||26:h.size+12*h.count(0)}}
</code>```

If only one hand has any cards, we want the empty hands to get a value of 26, and the hand with cards to get a value of 0. I do this by calling min on the hands - this returns nil for an empty array, and then I || it into 26. In other cases, I count the number of cards in a hand and then add 12 to the Queen of Spades.

Title: Score a hand of Hearts

Body:
Hearts is a trick-taking card game for 4 players. Each trick is taken by the player who played the highest card of the leading suit. At the end of each hand, the players incur a penalty score depending on the penalty cards they have taken; the task is to determine the scores under Microsoft Hearts rules.

Input

Input is 4 lists (or delimited string, array, etc.) showing the penalty cards taken by each of the 4 players. The penalty cards are

```<code>2♥, 3♥, 4♥, 5♥, 6♥, 7♥, 8♥, 9♥, 10♥, J♥, Q♥, K♥, A♥, Q♠
</code>```

which we shall represent as

```<code>2,  3,  4,   5,  6,  7,  8,  9,  10,  11, 12,  13,  1,  0
</code>```

respectively.

Output

Output is the 4 penalty points incurred by the 4 players (list, string, array etc.). Scoring is as follows:

Each heart (♥, represented by integers 1 to 13 inclusive) incurs 1 point

The queen of spades (Q♠, represented by 0) incurs 13 points

Exception: if a player has taken all of the penalty cards (called shooting the moon), then he incurs 0 points, while all other players incur 26 points.

Test cases

```<code>[2, 8, 7, 1], [3, 4], [], [9, 5, 6, 0, 10, 11, 12, 13]     -->  4,  2,  0, 20
[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [], [], [1]   --> 25,  0,  0,  1
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0], [], [], [] -->  0, 26, 26, 26
</code>```

Shortest code in bytes wins.

Body:
Ruby, 59 bytes

->a{a.map{|h|a.max.size>13?h.min||26:h.size+12*h.count(0)}}

Or, alternatively,

->a{a.map{|h|a.count([])>2?h.min||26:h.size+12*h.count(0)}}

If only one hand has any cards, we want the empty hands to get a value of 26, and the hand with cards to get a value of 0. I do this by calling min on the hands - this returns nil for an empty array, and then I || it into 26. In other cases, I count the number of cards in a hand and then add 12 to the Queen of Spades.


答:
APL, 18 bytes

```<code>{(⍴⍺)⍴X\⍵⍴⍨+/X←,⍺}
</code>```

This is a function that takes a boolean matrix as its left argument and a string as its right argument.

```<code>      (↑(1 0 0)(0 1 0)(1 0 1)) {(⍴⍺)⍴X\⍵⍴⍨+/X←,⍺}'lambda'
l
 a
m b
</code>```

Explanation:

APL has a built-in that does something like this, \ (expand). However, it only works on vectors, and it requires each character to be actually used.

X←,⍺: flatten the matrix and store the result in X.

⍵⍴⍨+/X: reshape the character vector so that it has the required amount of elements (this also takes care of lengthening the string by repeating characters if necessary).

X\: take one of the characters for each 1 and a space for each 0 in X.

(⍴⍺)⍴: reshape the result so that it has the shape of the original matrix.

Title: The Art of Word Shaping

Body:
The Art of Word Shaping

Given a binary matrix and a string of letters, replace all 1's in the matrix, moving from top to bottom and from left to right within each row, with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's with spaces. It's probably easier to just give an example or two.

Case: Base case...

Input One:

```<code>[0,0,1,0,0]
[0,1,0,1,0]
[1,0,0,0,1]
[0,1,0,1,0]
[0,0,1,0,0]

"PPCGPPCG"
</code>```

Output One:

```<code>  P
 P C
G   P
 P C
  G
</code>```

Case: If the input string is longer than the number of ones...

Input Two:

```<code>[1,0,0]
[0,1,0]
[1,0,1]

lambda
</code>```

Output Two:

```<code>l
 a
m b
</code>```

Case: If the input string is shorter than the number of ones...

Input Three:

```<code>[1,1,1]
[1,0,1]
[1,1,1]

PPCG
</code>```

Output Three:

```<code>PPC
G P
PCG
</code>```

Available Assumptions

You may assume the input string is never empty.

You may assume the matrix will never be empty.

You may not assume that the binary matrix will never be all zeros.

Rules

If the string is shorter than the number of ones, repeat the string; all ones must be replaced.

If the string is longer than the number of ones, only use what is needed.

You may use True/False in place of integers/bits for the input.

Trailing spaces ARE REQUIRED, all zeros must be replaced with spaces.

A single trailing newline is acceptable.

This is code-golf, lowest byte count wins.

Body:
APL, 18 bytes

{(⍴⍺)⍴X\⍵⍴⍨+/X←,⍺}

This is a function that takes a boolean matrix as its left argument and a string as its right argument.

      (↑(1 0 0)(0 1 0)(1 0 1)) {(⍴⍺)⍴X\⍵⍴⍨+/X←,⍺}'lambda'
l
 a
m b

Explanation:

APL has a built-in that does something like this, \ (expand). However, it only works on vectors, and it requires each character to be actually used.

X←,⍺: flatten the matrix and store the result in X.

⍵⍴⍨+/X: reshape the character vector so that it has the required amount of elements (this also takes care of lengthening the string by repeating characters if necessary).

X\: take one of the characters for each 1 and a space for each 0 in X.

(⍴⍺)⍴: reshape the result so that it has the shape of the original matrix.