Dig a border trench
$begingroup$
Background: Too many illegal immigrants from Blandia are crossing the border to Astan. The emperor of Astan has tasked you with digging a trench to keep them out, and Blandia must pay for the expenses. Since all typists have been furloughed until the trench is arranged, your code must be as short as possible.*
Task: Given a 2D map of the border between Astan and Blandia, make the Blands pay (with land) for a border trench.
For example: With Astanian cells marked A
, Blandic cells marked B
and trench cells marked +
(the map frames are only for clarity):
┌──────────┐ ┌──────────┐
│AAAAAAAAAA│ │AAAAAAAAAA│
│ABAAAAAABA│ │A+AAAAAA+A│
│ABBBAABABA│ │A+++AA+A+A│
│ABBBAABABA│ │A+B+AA+A+A│
│ABBBBABABA│→│A+B++A+A+A│
│ABBBBABBBB│ │A+BB+A++++│
│ABBBBABBBB│ │A+BB+A+BBB│
│ABBBBBBBBB│ │A+BB+++BBB│
│BBBBBBBBBB│ │++BBBBBBBB│
└──────────┘ └──────────┘
Details: The map will have at least three rows and three columns. The top row will be entirely Astanian and the bottom row will be entirely Blandic.
You may use any three values to represent Astanian territory, Blandic territory, and border trench, as long as input and output are consistent.
Automaton formulation: A Blandic cell with at least one Astanian cell in its Moore neighbourhood becomes a border trench cell.
Test cases
[
"AAAAAAAAAA",
"ABAAAAAABA",
"ABBBAABABA",
"ABBBAABABA",
"ABBBBABABA",
"ABBBBABBBB",
"ABBBBABBBB",
"ABBBBBBBBB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"A+AAAAAA+A",
"A+++AA+A+A",
"A+B+AA+A+A",
"A+B++A+A+A",
"A+BB+A++++",
"A+BB+A+BBB",
"A+BB+++BBB",
"++BBBBBBBB"
]
[
"AAA",
"AAA",
"BBB"
]
becomes:
[
"AAA",
"AAA",
"+++"
]
[
"AAAAAAAAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAAAAAAAA",
"BBBBBBABBB",
"BBBBBBAABB",
"BBBAAAAABB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"AAAA+++AAA",
"AAAA+B+AAA",
"AAAA+++AAA",
"AAAAAAAAAA",
"++++++A+++",
"BB++++AA+B",
"BB+AAAAA+B",
"BB+++++++B"
]
* DISCLAIMER: ANY RESEMBLANCE TO ACTUAL GEOPOLITICS IS PURELY COINCIDENTAL!
code-golf matrix cellular-automata
$endgroup$
add a comment |
$begingroup$
Background: Too many illegal immigrants from Blandia are crossing the border to Astan. The emperor of Astan has tasked you with digging a trench to keep them out, and Blandia must pay for the expenses. Since all typists have been furloughed until the trench is arranged, your code must be as short as possible.*
Task: Given a 2D map of the border between Astan and Blandia, make the Blands pay (with land) for a border trench.
For example: With Astanian cells marked A
, Blandic cells marked B
and trench cells marked +
(the map frames are only for clarity):
┌──────────┐ ┌──────────┐
│AAAAAAAAAA│ │AAAAAAAAAA│
│ABAAAAAABA│ │A+AAAAAA+A│
│ABBBAABABA│ │A+++AA+A+A│
│ABBBAABABA│ │A+B+AA+A+A│
│ABBBBABABA│→│A+B++A+A+A│
│ABBBBABBBB│ │A+BB+A++++│
│ABBBBABBBB│ │A+BB+A+BBB│
│ABBBBBBBBB│ │A+BB+++BBB│
│BBBBBBBBBB│ │++BBBBBBBB│
└──────────┘ └──────────┘
Details: The map will have at least three rows and three columns. The top row will be entirely Astanian and the bottom row will be entirely Blandic.
You may use any three values to represent Astanian territory, Blandic territory, and border trench, as long as input and output are consistent.
Automaton formulation: A Blandic cell with at least one Astanian cell in its Moore neighbourhood becomes a border trench cell.
Test cases
[
"AAAAAAAAAA",
"ABAAAAAABA",
"ABBBAABABA",
"ABBBAABABA",
"ABBBBABABA",
"ABBBBABBBB",
"ABBBBABBBB",
"ABBBBBBBBB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"A+AAAAAA+A",
"A+++AA+A+A",
"A+B+AA+A+A",
"A+B++A+A+A",
"A+BB+A++++",
"A+BB+A+BBB",
"A+BB+++BBB",
"++BBBBBBBB"
]
[
"AAA",
"AAA",
"BBB"
]
becomes:
[
"AAA",
"AAA",
"+++"
]
[
"AAAAAAAAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAAAAAAAA",
"BBBBBBABBB",
"BBBBBBAABB",
"BBBAAAAABB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"AAAA+++AAA",
"AAAA+B+AAA",
"AAAA+++AAA",
"AAAAAAAAAA",
"++++++A+++",
"BB++++AA+B",
"BB+AAAAA+B",
"BB+++++++B"
]
* DISCLAIMER: ANY RESEMBLANCE TO ACTUAL GEOPOLITICS IS PURELY COINCIDENTAL!
code-golf matrix cellular-automata
$endgroup$
$begingroup$
Political satire in the form of code golf, I love it :o)
$endgroup$
– Sok
1 hour ago
add a comment |
$begingroup$
Background: Too many illegal immigrants from Blandia are crossing the border to Astan. The emperor of Astan has tasked you with digging a trench to keep them out, and Blandia must pay for the expenses. Since all typists have been furloughed until the trench is arranged, your code must be as short as possible.*
Task: Given a 2D map of the border between Astan and Blandia, make the Blands pay (with land) for a border trench.
For example: With Astanian cells marked A
, Blandic cells marked B
and trench cells marked +
(the map frames are only for clarity):
┌──────────┐ ┌──────────┐
│AAAAAAAAAA│ │AAAAAAAAAA│
│ABAAAAAABA│ │A+AAAAAA+A│
│ABBBAABABA│ │A+++AA+A+A│
│ABBBAABABA│ │A+B+AA+A+A│
│ABBBBABABA│→│A+B++A+A+A│
│ABBBBABBBB│ │A+BB+A++++│
│ABBBBABBBB│ │A+BB+A+BBB│
│ABBBBBBBBB│ │A+BB+++BBB│
│BBBBBBBBBB│ │++BBBBBBBB│
└──────────┘ └──────────┘
Details: The map will have at least three rows and three columns. The top row will be entirely Astanian and the bottom row will be entirely Blandic.
You may use any three values to represent Astanian territory, Blandic territory, and border trench, as long as input and output are consistent.
Automaton formulation: A Blandic cell with at least one Astanian cell in its Moore neighbourhood becomes a border trench cell.
Test cases
[
"AAAAAAAAAA",
"ABAAAAAABA",
"ABBBAABABA",
"ABBBAABABA",
"ABBBBABABA",
"ABBBBABBBB",
"ABBBBABBBB",
"ABBBBBBBBB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"A+AAAAAA+A",
"A+++AA+A+A",
"A+B+AA+A+A",
"A+B++A+A+A",
"A+BB+A++++",
"A+BB+A+BBB",
"A+BB+++BBB",
"++BBBBBBBB"
]
[
"AAA",
"AAA",
"BBB"
]
becomes:
[
"AAA",
"AAA",
"+++"
]
[
"AAAAAAAAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAAAAAAAA",
"BBBBBBABBB",
"BBBBBBAABB",
"BBBAAAAABB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"AAAA+++AAA",
"AAAA+B+AAA",
"AAAA+++AAA",
"AAAAAAAAAA",
"++++++A+++",
"BB++++AA+B",
"BB+AAAAA+B",
"BB+++++++B"
]
* DISCLAIMER: ANY RESEMBLANCE TO ACTUAL GEOPOLITICS IS PURELY COINCIDENTAL!
code-golf matrix cellular-automata
$endgroup$
Background: Too many illegal immigrants from Blandia are crossing the border to Astan. The emperor of Astan has tasked you with digging a trench to keep them out, and Blandia must pay for the expenses. Since all typists have been furloughed until the trench is arranged, your code must be as short as possible.*
Task: Given a 2D map of the border between Astan and Blandia, make the Blands pay (with land) for a border trench.
For example: With Astanian cells marked A
, Blandic cells marked B
and trench cells marked +
(the map frames are only for clarity):
┌──────────┐ ┌──────────┐
│AAAAAAAAAA│ │AAAAAAAAAA│
│ABAAAAAABA│ │A+AAAAAA+A│
│ABBBAABABA│ │A+++AA+A+A│
│ABBBAABABA│ │A+B+AA+A+A│
│ABBBBABABA│→│A+B++A+A+A│
│ABBBBABBBB│ │A+BB+A++++│
│ABBBBABBBB│ │A+BB+A+BBB│
│ABBBBBBBBB│ │A+BB+++BBB│
│BBBBBBBBBB│ │++BBBBBBBB│
└──────────┘ └──────────┘
Details: The map will have at least three rows and three columns. The top row will be entirely Astanian and the bottom row will be entirely Blandic.
You may use any three values to represent Astanian territory, Blandic territory, and border trench, as long as input and output are consistent.
Automaton formulation: A Blandic cell with at least one Astanian cell in its Moore neighbourhood becomes a border trench cell.
Test cases
[
"AAAAAAAAAA",
"ABAAAAAABA",
"ABBBAABABA",
"ABBBAABABA",
"ABBBBABABA",
"ABBBBABBBB",
"ABBBBABBBB",
"ABBBBBBBBB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"A+AAAAAA+A",
"A+++AA+A+A",
"A+B+AA+A+A",
"A+B++A+A+A",
"A+BB+A++++",
"A+BB+A+BBB",
"A+BB+++BBB",
"++BBBBBBBB"
]
[
"AAA",
"AAA",
"BBB"
]
becomes:
[
"AAA",
"AAA",
"+++"
]
[
"AAAAAAAAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAABBBAAA",
"AAAAAAAAAA",
"BBBBBBABBB",
"BBBBBBAABB",
"BBBAAAAABB",
"BBBBBBBBBB"
]
becomes:
[
"AAAAAAAAAA",
"AAAA+++AAA",
"AAAA+B+AAA",
"AAAA+++AAA",
"AAAAAAAAAA",
"++++++A+++",
"BB++++AA+B",
"BB+AAAAA+B",
"BB+++++++B"
]
* DISCLAIMER: ANY RESEMBLANCE TO ACTUAL GEOPOLITICS IS PURELY COINCIDENTAL!
code-golf matrix cellular-automata
code-golf matrix cellular-automata
edited 13 mins ago
Adám
asked 1 hour ago
AdámAdám
29.2k269192
29.2k269192
$begingroup$
Political satire in the form of code golf, I love it :o)
$endgroup$
– Sok
1 hour ago
add a comment |
$begingroup$
Political satire in the form of code golf, I love it :o)
$endgroup$
– Sok
1 hour ago
$begingroup$
Political satire in the form of code golf, I love it :o)
$endgroup$
– Sok
1 hour ago
$begingroup$
Political satire in the form of code golf, I love it :o)
$endgroup$
– Sok
1 hour ago
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
JavaScript (ES7), 84 82 bytes
Saved 2 bytes thanks to @Shaggy
Takes input as a matrix of integers, with $3$ for Astan and $0$ for Blandia. Returns a matrix with the additional value $1$ for the trench.
a=>(g=x=>a.map(t=(r,Y)=>r.map((v,X)=>1/x?t|=(x-X)**2+(y-Y)**2<v:v||g(X,y=Y)|t)))()
Try it online!
$endgroup$
$begingroup$
82 bytes?
$endgroup$
– Shaggy
53 mins ago
$begingroup$
@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!
$endgroup$
– Arnauld
50 mins ago
$begingroup$
I was only thinking the same thing earlier!
$endgroup$
– Shaggy
49 mins ago
add a comment |
$begingroup$
Wolfram Language (Mathematica), 39 bytes
MorphologicalPerimeter[#,Padding->1]+#&
Try it online!
What else would we expect from Mathematica? Characters used are {Astan -> 0, Blandia -> 1, Trench -> 2}
.
$endgroup$
1
$begingroup$
;-; what the heck mathematica
$endgroup$
– HyperNeutrino
33 mins ago
add a comment |
$begingroup$
K (ngn/k), 23 bytes
{x+x&2{++/'3'0,x,0}/~x}
Try it online!
uses 0 1 2
for A
, B
, and +
{
}
function with argument x
~x
logical not
2{
}/
twice do
0,x,0
surround with 0-s (top and bottom)
3'
triples of consecutive rows
+/'
sum each
+
transpose
x&
minima between x
and
x+
add x
to
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "200"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f178809%2fdig-a-border-trench%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
JavaScript (ES7), 84 82 bytes
Saved 2 bytes thanks to @Shaggy
Takes input as a matrix of integers, with $3$ for Astan and $0$ for Blandia. Returns a matrix with the additional value $1$ for the trench.
a=>(g=x=>a.map(t=(r,Y)=>r.map((v,X)=>1/x?t|=(x-X)**2+(y-Y)**2<v:v||g(X,y=Y)|t)))()
Try it online!
$endgroup$
$begingroup$
82 bytes?
$endgroup$
– Shaggy
53 mins ago
$begingroup$
@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!
$endgroup$
– Arnauld
50 mins ago
$begingroup$
I was only thinking the same thing earlier!
$endgroup$
– Shaggy
49 mins ago
add a comment |
$begingroup$
JavaScript (ES7), 84 82 bytes
Saved 2 bytes thanks to @Shaggy
Takes input as a matrix of integers, with $3$ for Astan and $0$ for Blandia. Returns a matrix with the additional value $1$ for the trench.
a=>(g=x=>a.map(t=(r,Y)=>r.map((v,X)=>1/x?t|=(x-X)**2+(y-Y)**2<v:v||g(X,y=Y)|t)))()
Try it online!
$endgroup$
$begingroup$
82 bytes?
$endgroup$
– Shaggy
53 mins ago
$begingroup$
@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!
$endgroup$
– Arnauld
50 mins ago
$begingroup$
I was only thinking the same thing earlier!
$endgroup$
– Shaggy
49 mins ago
add a comment |
$begingroup$
JavaScript (ES7), 84 82 bytes
Saved 2 bytes thanks to @Shaggy
Takes input as a matrix of integers, with $3$ for Astan and $0$ for Blandia. Returns a matrix with the additional value $1$ for the trench.
a=>(g=x=>a.map(t=(r,Y)=>r.map((v,X)=>1/x?t|=(x-X)**2+(y-Y)**2<v:v||g(X,y=Y)|t)))()
Try it online!
$endgroup$
JavaScript (ES7), 84 82 bytes
Saved 2 bytes thanks to @Shaggy
Takes input as a matrix of integers, with $3$ for Astan and $0$ for Blandia. Returns a matrix with the additional value $1$ for the trench.
a=>(g=x=>a.map(t=(r,Y)=>r.map((v,X)=>1/x?t|=(x-X)**2+(y-Y)**2<v:v||g(X,y=Y)|t)))()
Try it online!
edited 51 mins ago
answered 58 mins ago
ArnauldArnauld
73.2k689307
73.2k689307
$begingroup$
82 bytes?
$endgroup$
– Shaggy
53 mins ago
$begingroup$
@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!
$endgroup$
– Arnauld
50 mins ago
$begingroup$
I was only thinking the same thing earlier!
$endgroup$
– Shaggy
49 mins ago
add a comment |
$begingroup$
82 bytes?
$endgroup$
– Shaggy
53 mins ago
$begingroup$
@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!
$endgroup$
– Arnauld
50 mins ago
$begingroup$
I was only thinking the same thing earlier!
$endgroup$
– Shaggy
49 mins ago
$begingroup$
82 bytes?
$endgroup$
– Shaggy
53 mins ago
$begingroup$
82 bytes?
$endgroup$
– Shaggy
53 mins ago
$begingroup$
@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!
$endgroup$
– Arnauld
50 mins ago
$begingroup$
@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!
$endgroup$
– Arnauld
50 mins ago
$begingroup$
I was only thinking the same thing earlier!
$endgroup$
– Shaggy
49 mins ago
$begingroup$
I was only thinking the same thing earlier!
$endgroup$
– Shaggy
49 mins ago
add a comment |
$begingroup$
Wolfram Language (Mathematica), 39 bytes
MorphologicalPerimeter[#,Padding->1]+#&
Try it online!
What else would we expect from Mathematica? Characters used are {Astan -> 0, Blandia -> 1, Trench -> 2}
.
$endgroup$
1
$begingroup$
;-; what the heck mathematica
$endgroup$
– HyperNeutrino
33 mins ago
add a comment |
$begingroup$
Wolfram Language (Mathematica), 39 bytes
MorphologicalPerimeter[#,Padding->1]+#&
Try it online!
What else would we expect from Mathematica? Characters used are {Astan -> 0, Blandia -> 1, Trench -> 2}
.
$endgroup$
1
$begingroup$
;-; what the heck mathematica
$endgroup$
– HyperNeutrino
33 mins ago
add a comment |
$begingroup$
Wolfram Language (Mathematica), 39 bytes
MorphologicalPerimeter[#,Padding->1]+#&
Try it online!
What else would we expect from Mathematica? Characters used are {Astan -> 0, Blandia -> 1, Trench -> 2}
.
$endgroup$
Wolfram Language (Mathematica), 39 bytes
MorphologicalPerimeter[#,Padding->1]+#&
Try it online!
What else would we expect from Mathematica? Characters used are {Astan -> 0, Blandia -> 1, Trench -> 2}
.
answered 34 mins ago
lirtosiastlirtosiast
15.8k436107
15.8k436107
1
$begingroup$
;-; what the heck mathematica
$endgroup$
– HyperNeutrino
33 mins ago
add a comment |
1
$begingroup$
;-; what the heck mathematica
$endgroup$
– HyperNeutrino
33 mins ago
1
1
$begingroup$
;-; what the heck mathematica
$endgroup$
– HyperNeutrino
33 mins ago
$begingroup$
;-; what the heck mathematica
$endgroup$
– HyperNeutrino
33 mins ago
add a comment |
$begingroup$
K (ngn/k), 23 bytes
{x+x&2{++/'3'0,x,0}/~x}
Try it online!
uses 0 1 2
for A
, B
, and +
{
}
function with argument x
~x
logical not
2{
}/
twice do
0,x,0
surround with 0-s (top and bottom)
3'
triples of consecutive rows
+/'
sum each
+
transpose
x&
minima between x
and
x+
add x
to
$endgroup$
add a comment |
$begingroup$
K (ngn/k), 23 bytes
{x+x&2{++/'3'0,x,0}/~x}
Try it online!
uses 0 1 2
for A
, B
, and +
{
}
function with argument x
~x
logical not
2{
}/
twice do
0,x,0
surround with 0-s (top and bottom)
3'
triples of consecutive rows
+/'
sum each
+
transpose
x&
minima between x
and
x+
add x
to
$endgroup$
add a comment |
$begingroup$
K (ngn/k), 23 bytes
{x+x&2{++/'3'0,x,0}/~x}
Try it online!
uses 0 1 2
for A
, B
, and +
{
}
function with argument x
~x
logical not
2{
}/
twice do
0,x,0
surround with 0-s (top and bottom)
3'
triples of consecutive rows
+/'
sum each
+
transpose
x&
minima between x
and
x+
add x
to
$endgroup$
K (ngn/k), 23 bytes
{x+x&2{++/'3'0,x,0}/~x}
Try it online!
uses 0 1 2
for A
, B
, and +
{
}
function with argument x
~x
logical not
2{
}/
twice do
0,x,0
surround with 0-s (top and bottom)
3'
triples of consecutive rows
+/'
sum each
+
transpose
x&
minima between x
and
x+
add x
to
answered 29 mins ago
ngnngn
6,96112559
6,96112559
add a comment |
add a comment |
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f178809%2fdig-a-border-trench%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Political satire in the form of code golf, I love it :o)
$endgroup$
– Sok
1 hour ago