CMC: Double a number using only ASCII characters. In addition, it has to be input-safe i.e. no matter how many inputs it's given it returns the correct answer for the first input (to prevent answers such as + in Jelly)
The thing is that functions are usually shorter and they’re accepted on PPCG; if you want to compete well here, you might want to try to use those too sometimes
What about this? Finding the max element of a grid that has 4 strictly-lower neighbors, if none exists, output -666
e.g. 3 3 1 2 2 1 3 1 2 2 1
output 3
my current attempt
R,C=map(int,input().split())
g=[list(map(int,input().split())) for i in ' '*R]
s=-666
for r in range(1,R-1):
for c in range(1,C-1):
if all(g[r+i][c+j] < g[r][c] for i,j in [(0,1),(0,-1),(1,0),(-1,0)]):s=max(s,g[r][c])
print(s)
R,C=map(int,input().split())
g=[list(map(int,input().split()))for i in' '*R]
s=-666
for r in range(1,R-1):
for c in range(1,C-1):
if all(g[r+i][c+j]<g[r][c]for i,j in[(0,1),(0,-1),(1,0),(-1,0)]):s=max(s,g[r][c])
print(s)
R,C=map(int,input().split())
g=[[*map(int,input().split())]for i in' '*R]
s=-666
for r in range(1,R-1):
for c in range(1,C-1):
if all(g[r+i][c+j]<g[r][c]>g[r-i][c-j]for i,j in[(0,1),(1,0)]):s=max(s,g[r][c])
print(s)
@Mr.Xcoder Contact: shinichiro.hamaji _at_ gmail.com . If you found some bugs or you have some requests (fix problem you submitted, add language XXX, and etc.), please email me.
@EriktheOutgolfer I didn't even know that site existed until a few minutes ago, I just assumed there was some contact information somewhere in there and looked for it :p
Jelly, 15 bytes
LŒ!ðŒcIṠ;ị"Pð€S
Try it online!
How it works
LŒ!ðŒcIṠ;ị"Pð€S input
L length
Œ! all_permutations
ð ð€ for each permutation:
Œc take all unordered pairs
I calculate the difference between
...
SANDBOX NOTE I'm serious. This is no less interesting of a challenge than 99 Bottles, or Hello World, or any other simple kolmogorov-complexity challenge.
Return the n-th prime code-golf kolmogorov-complexity
Write a function that, given a number n, returns the n-th prime.
Inspiration. You...
Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in many languages.
Rosetta code features lists by language of idiomatic approaches to primality te...
Its native form is a bunch of arithmetic code tables, and the language automatically and repeatedly does lookups using its current table, stopping once it is told to
A stack is available for computation if needed, and tables can be switched and pished extremely concisely
*pushed
Basically, it is a tring complete compression format disguised as a golfing language
Don't you just love it when you go through old code of yours and you find a bunch of garbage placeholder strings that you threw in there for testing and then forgot to remove?
The Quantum Drunkard's Walk
code-golfascii-artgrid
It is well known that a person on a grid under the influence of alcohol has an equal chance of going in any available directions. However, this common-sense statement does not hold in the realm of very small drunkards, whose behavior is very mu...
@AdmBorkBork Not anymore. We're currently switching devs over to Rider (for a many million lines C# project). VS performance has been degrading since 13 Ultimate
VS remains for Windows driver development. For now.
@mınxomaτ Nice. I've been using Rider for a long time, and it used to only allow Core and Mono. I'm glad that it supports Framework now, but as of late I've found that I can make Core projects for everything.
> This is Javascript. The standards have contained confusing and unpredictable edge-case behavior since the language was invented. Changing that now would be ridiculous.
So say there is an exam (taken out of 100) and the maximum on it is 79, the average is 48. Say someone curves the grade, then how would the grade distributions be?
@Ponponhollamon One of my professors would do a +21 flat to all grades, making the max 100, the rest literally +21 to the score. Usually when tests are that low... I mean, it's the teachers fault.
PCRE flavor, 261 289 210 184 127 109 71 53 51 44 40 bytes
Yes, it is possible!
<^<()(?R){2}>\z|\1\Q^<()(?R){2}>\z|\1\Q>
Try it here. (But / is shown to be the delimiter on Regex101.)
Please refrain from making unnecessary edits (updates) on the Regex101 page. If your edit doesn't actually in...