instruction stringlengths 34 53.1k |
|---|
Inspired by a now deleted StackOverflow question. Can you come up with a way to get a particular method executed, without explicitly calling it? The more indirect it is, the better.
Here's what I mean, exactly (C used just for exemplification, all languages accepted):
// Call this.
void the_function(void)
{
printf... |
Everyone knows the phrase "Rules are made to be broken!", so here is your task:
Write some code in any language that breaks a standard. This can be anything, from putting
240 volts down a USB cable, to pinging your router (NOT somebody else's website!) with a 10mb packet! (Don't get any ideas, both of these will proba... |
You will take input such as
http://examples.example.co.nz/abcdefg
and return the name of the website, in which this example would be example.
To be more specific, I am looking for the Second Level Domain, which immediately precedes the TLD (Top Level Domain), but the Third Level Domain if the website is a Country Code ... |
Create a deterministic program to play nd tic-tac-toe with the other contestants.
Your program should work when n (width) and d (dimension number) are in these ranges:
n∈[3,∞)∩ℕ ie a natural number greater than 2
d∈[2,∞)∩ℕ ie a natural number greater than 1
n = 3; d = 2 (32 ie 3 by 3):
[][][]
[][][]
[][][]
n = 3; ... |
Task:
Create an obfuscated program that prints Hello World! (exactly like that). Your program may not have any strings in it.
Rules:
You can use any programming language you like.
Make it as obfuscated as possible
This is a popularity-contest, so the answer with the most upvotes wins.
Note:
This is not a duplicate o... |
Task:
Create a program that will take an acronym as input, for example dftba, and generate some possible phrases that the acronym could stand for. You can use wordlist as word input. Inspired by https://www.youtube.com/watch?v=oPUxnpIWt6E
Example:
input: dftba
output: don't forget to be awesome
Rules:
Your program ca... |
Write a program to solve a series of linear equations as short as possible. It must solve arbitrary number of equations problems. They can inputted however you like, coefficients of augmented matrix is probably the easiest. The program doesn't have to handle non-integer coefficients or solutions. No degenerate or inval... |
Your challenge is to take input like this (a Hello World program):
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
And output a prompt (which will be "> "):
>
The user can then enter anything at the prompt. Your simple debugger must have these commands:
S - ... |
Create a program to display some approximation of a bell curve. You are free to use whatever method you wish for generating the data, but the data must be displayed vertically, as in oriented like so:
Other restrictions:
Your code must create the approximation, that is, don't hardcode or take data from the internet.
... |
The Utah teapot, originally created by Martin Newell, is a convenient object for testing 3D graphics programs.
The task is to create a wireframe image of the teapot in perspective projection. To encourage the idea of a source-code application, the viewing and camera control may be isolated and excluded from the count. ... |
Write a program that produces mirror images of itself. An example, would be the fantastic camel code that reads it's own code and produces two smaller 2x2 versions. Given the input:
$_='ev
al("seek\040D
ATA,0, ... |
Computers do not out-of-nowhere create random numbers without basis, as most likely, time is the universal basis of randomness.
I want you to create a code that creates random numbers with these rules:
Time is not allowed to be the basis, at any point of the program.
Predefined random/pseudo-random functions are not a... |
Your task here is to write two regular expressions, each of which matches the other one but does not match itself.
Both regular expressions should have this form:
/pattern/optional-flags
This is also the form in which they should be matched.
The shortest solution wins. The solution length is counted as the sum of char... |
Here's an interesting challenge...
I want you to golf code that when executed will allow your input to be converted to mimic output as though you were typing on a DVORAK keyboard layout.
The aim is to mimic the US Simplified Dvorak Keyboard (US:SDK)
In comparison, here is the standard US QWERTY layout:
The keyboard e... |
Your job, for this golf, is to write a program that will take moves of a game of reversi (othello) and display the result to the user.
Input
A string of numbers taken from the range [0-7]. Each pair of numbers represent first the X coordinate, then the Y coordinate. Any characters not in that range should be ignored.
O... |
Provided an input as an unsigned integer:
13457
Your function/subroutine should return:
75431
Since this is a popularity contest, be creative. Creative solutions use unusual or clever techniques to accomplish given task.
Constraints:
You cannot use arrays.
You cannot use strings.
No RTL Override (‮)
Brownie po... |
This challenge challenges you to write a function that will take as its argument an array that specifies the types of input, an optional prompt, and a verification key; inputs and validates the values; and returns them.
Input types:
b - Boolean values.
c - Characters.
i - Integer values, rejects floating point val... |
Challenge: Implement ROT-47 in code that works as both itself and as the ROT-47 version of itself.
Scoring:
Your score is calculated as a percentage of used, ROT-47 eligible bytes in total of both versions of the program divided by total bytes (all characters) of both versions.
A used, ROT-47 eligible byte is any chara... |
Write the shortest program you can that displays a red 3D cube.
Rules:
The cube must be red, have 6 rendered sides, and be displayed in 3D.
Your program cannot load any textures.
More than 1 side must be visible.
The result does not need to be rotatable.
|
I seem to have gotten myself into a bit of a pickle. Literally. I dropped a bunch of pickles on the floor and now they're all scattered about! I need you to help me collect them all. Oh, did I mention I have a bunch of robots at my command? (They're also all scattered all over the place; I'm really bad at organizing th... |
Imagine the following scenario: you are playing battleships with a friend but decide to cheat. Rather than moving a ship after he shoots where your ship used to be, you decide not to place any ships at all. You tell him all his shots are misses, until it is impossible to place ships in such a way.
You have to write a f... |
Let n be the number of times your program has been executed. If n is a power of 2, then print 2^x where n = 2^x; otherwise, simply output the number. Example run:
[1st time] 2^0
[2nd time] 2^1
[3rd time] 3
[4th time] 2^2
[5th time] 5
and so on. This is a popularity contest, so the answer with the most upvotes wins..
|
You have to make a game Too-low --- Too-high (TLTH) in shortest code (in bytes)
Game rules:
Computer will choose a random number out of integer range (-32768..32767).
Now you will think of a number and input it.
The computer will tell if your number is lower (TOO LOW) or higher (TOO HIGH) than the chosen number.
W... |
I challenge you to write a code to make an (extended) ASCII-art logic gate diagram for the sum of products form of an equation.
Use the following notation to represent gates:
AND
INPUT───|&&
|&&───OUTPUT
INPUT───|&&
OR
INPUT───|OR
|OR───OUTPUT
INPUT───|OR
Gates with more... |
A rhyming program you write
Attempting to win the fight
For winning the contest and vote
It must compute "Hello World"
Then print it very polite
The most popular poem will win.
The requirements are:
The poem should be of 5 lines with rhymes AABBA
It can print whatever you want, but the output should contain "hello wo... |
Inspired by the Google Code Challenge:
The Latin alphabet contains 26 characters and telephones only have ten digits on the keypad. We would like to make it easier to write a message to your friend using a sequence of keypresses to indicate the desired characters. The letters are mapped onto the digits as shown below.... |
Undefined Behavior Killed My Cat
It's well known that undefined behavior can kill your cat [citation needed].
But can it?
Your Task
Write a program that invokes undefined behavior.
Describe a scenario that starts with the above program being run, resulting in a Felis catus ending its life while in your ownership, as a... |
Task:
I know we can all add two numbers the short way, using +. Your task is to create the longest code you can to add two input numbers.
Rules:
All of the code must be on topic (don't fill it with non-addition code to add length)
The count is in characters, but do not count tabs, spaces, or newlines.
Do not use extra... |
In a chatroom with a few people, a topic came up between me and them about how many possible strings a regex could match.
Your task is to build a program that can answer that question.
Your program will accept, as input, any regular expression as defined in this document as an "extended regular expression", such as:
^[... |
In 1946 Erdos and Copeland proved that a certain number is a normal number, i.e. the digits in its decimal expansion are uniformly distributed.
Users will input a sequence of digits and you will find the smallest prime that contains that string in base 10.
Example:
input -> output
"10" -> 101
"03" -> 103
"222" ... |
This is a really neat short challenge.
Write a function or a procedure that takes two parameters, x and y and returns the result of xy WITHOUT using loops, or built in power functions.
The winner is the most creative solution, and will be chosen based on the highest number of votes after 3 days.
|
Provided a digit between 0 and 9 (inclusive), your function/subroutine should print all numbers between -100 and 100 (inclusive) that contain the given digit.
For example:
Input: 9
Output: -99 -98 -97 -96 -95 -94 -93 -92 -91 -90 -89 -79 -69 -59 -49 -39 -29 -19 -9 9 19 29 39 49 59 69 79 89 90 91 92 93 94 95 96 97 98 99
... |
Your goal is to write "Hello, World!" (minus the quotes). This is a popularity-contest, so most up votes wins. Code length will be used to break ties.
Anything goes, as long as it is within the following rules:
All characters must be either letters or numbers, so you may only use characters in the string "abcdefghijk... |
Your challenge today is to cheat at badges!
You will build a bot that will connect to a Stack Exchange site, log in as you, visit the /questions page, visit a question, and then visit 9 other questions in the "related" sidebar (because that seems sufficient to count as "activity," and I need to standardize on something... |
The challenge is: generate an audio file made of white noise.
Requirements and instructions:
Your program must generate an audio file containing only white noise, meaning its intensity is the same for all (reasonable) frequencies and nonzero [see an example plot];
One must be able to play the audio file on the latest ... |
Write the shortest code that will take any real number greater than 1 as input and will output its positive inverse factorial. In other words, it answers the question "what number factorial is equal to this number?". Use the Gamma function to extend the definition for factorial to any real number as described here.
For... |
We all know that programmers tend to be lazy. In order to maximize your free time, you decide to write a program that outputs a minimal number of keystrokes for text fed into it.
Input: Text that has to be converted into keystrokes. You may decide on how to input the text (STDIN / reading from a file provided in the a... |
You have to create a code which prints
:)
a random number of times from 1 to 255 inclusive. Your output may not contain any whitespace.
Your score :
The count in bytes
EDIT : Also show 3 outputs of your code
|
Challenge
Recognize ASCII art numbers. To make things interesting, three random points in the image might be flipped. For example:
*****
* **
**
**
**
**
Input
A 7x7 ASCII art number generated by the below Python script.
Output
A digit.
Testing script
Here's a Python script (2.6+) to generate... |
Code golf: Print an image of the source code.
Requirements
Must output the image of the source code itself, not a version stored elsewhere and retrieved at run time.
Code must be legible enough to copy out by hand and reproduce the results.
Any image format is applicable.
Bonuses
-10% of your score if you allow mor... |
Write the shortest POSIX-form regular expression that matches only non-negative integers divisible by 9. The non-negative integer should be given in base 10.
|
In Twitch Plays Pokémon, one of the most annoying obstacles one can face is an ice puzzle, where you must travel from one place to another by sliding all the way in one direction until you either hit a wall or a boulder.
Your task is to build a program that will generate a random difficult ice puzzle.
Your program will... |
Your task is simple. Write a program that should obviously produce an error on first glance either when compiled or run, but either doesn't or produces some other unrelated error. This is a popularity contest, so be creative.
|
The Problem
A doomsday scenario is described by three numbers on a single line, n, m, and p. Following that line are n lines with m values per line. Each value represents the total units of water each cell can hold.
The following p lines describe the weather for the next p days. 1 unit of rain falls on a single cell ea... |
Write a program that takes two lines of input and uses the first as a key phrase to encrypt the second according to the Playfair encryption technique.
Wikipedia describes Playfair encryption in some detail, but to avoid any ambiguity, here's a brief summary:
1. Generate a key table:
Replace all occurrences of J in the ... |
Ever programmer knows, that programs need to be predictable. Any code that is not predictable will do something undefined and therefore most likely crash or worse. But when I tried to figure out what Java's lazySet() method does, I came up with the idea
Is it possible to write a program that is unpredictable, yet works... |
Write a quine... from which every other character can be removed it still be a valid quine. You can specify whether to start removing characters at the first or second character.
Scoring criteria (add bonuses/penatly percentages together for total percentage):
Answers must be at least 4 characters long
Program must co... |
…without using any operator/function besides addition (+), subtraction (-), multiplication (*), division (/), modulo (%), exponent/power pow() or any of the standard C bitwise operators (<<, >>, ~, &, |, ^) or unary operators (—, ++) or assignment/comparison operators (=, ==).
If these symbols represent a different ope... |
Your goal is to output an ASCII art pie chart. This is code-golf, so the shortest program (counting the bytes of the source code, not the characters) wins.
No external softwares or APIs are allowed. Only the native ones of each language.
The starting angle and the direction (clockwise/anticlockwise) of the circle are n... |
Your program must take as input a line of characters, like this:
@+.0
And output the characters sorted by how dark they are, like this:
.+0@
Requirements:
You must use a monospaced font for darkness detection.
You must find out how many pixels each character takes up. You must actually draw the character and count p... |
Write an object-oriented program that, when ran, outputs one complete example from each reserved-word-vise unique signature combination available to that language. Reserved words for primitive types are excluded. Each example should start from a new line.
This implies that for all signatures any changes in parameters, ... |
Imagine an ordered file set : file1, file2, ... fileN.
Each file is a textual file that is made of lines that have the same format : A concatenation of a fixed-size key (the same among all the file set) and a variable length value.
The merging algorithm is very similar to UPSERT :
To merge 2 files:
Iterate on all li... |
Code Golfed Tetris
Inspired by a popularity-question (Re)Implementing Tetris and a challenge on SO 3 years ago when PCG did not yet exist, the classy tetris has yet to live again in the art-work of PCG's golfers. So here are the features:
Required:
Game must be playable.
Playfield or blocks are 10 in width and 20 in h... |
Introduction
Knowledgeable code golfers prepared us for the doomsday flood. Areas at risk were evacuated, and the population moved to high ground.
We underestimated the flood (or perhaps there was a bug in @user12345's code). Some high-ground areas are rapidly approaching sea level. Walls must be erected in order to en... |
Most of you have probably heard of the famous Turtle Graphics program, initially made popular by Logo. This challenge is to implement a Turtle Graphics program in your language of choice.
Rules:
The floor must be a diagonal with dimensions input by the user through std-in in the form x/y, representing the x and y len... |
I always used a Mandelbrot image as the 'graphical' version of Hello World in any graphical application I got my hands on. Now it's your guys' turn.
Language must be capable of graphical output or drawing charts (saving files disallowed)
Render a square image or graph. The size at least 128 and at most 640 across*
The... |
In the Pokemon video games, the player is sent out into the world to force wild animals into tiny balls and train them to fight. Of course, everyone knows that no one plays Pokemon for the battling. The real draw the series has is the pokemon catching itself! Your job is to simulate the pokeball during a capture attemp... |
Well, when I buy gifts for my two wives, I want them to feel equally important to me, but it's hard to go shopping with fixed budgets. Instead, I buy a bunch of stuff and divide them into two groups with as equal value as possible. Then I buy a bunch of chocolates to fix the rest.
But I don't want do all the hard lifti... |
Your task is to write the shortest possible Pong game without human interaction, so AI plays vs AI. I assume all of you know Pong, just to make sure, this is the target (just as running code):http://www.youtube.com/watch?v=xeEFMhdnR6c
The following game rules apply:
No ASCII "graphics".
You must actually have code to ... |
Yesterday at work, the Google Doodle convinced me to share my rather long gender swap script here, but the code-golf criteria of the question i asked were not clear. As my question still got downvoted after giving examples, i changed the tag to popularity-contest, as suggested before i clarified it.
Here's a more golfy... |
To solve the Halting Problem you are given a description of a program, and must determine whether or not it will ever finish. You can never do this for all programs. Yet for programs like (in brainf***):
>
It obviously will halt, and for programs like:
+[]
It obviously will not. Your challenge is to "solve" the halti... |
Implement a program or function which simulates common dice for role playing games. It should handle at least the d6 and d20, the two most common dice.
However, it should work as stereotypical gamers expect them to work, and not as real dice work.
It is an in-joke between gamers, that one can have a specially lucky die... |
Write a series of programs in the same language that print “Hello, world!” using n distinct source characters, where n is in [1..10] inclusive (“distinct” meaning that duplicate characters are ignored from character count). The winner is the solution with the most programs, each with distinct n. I suggest making one so... |
The results are in, the contest is over.
The winner is arshajii's EvilBot with 14 wins ahead of Neo-Bot with 13 wins and CentreBot and LastStand with 11 wins each.
Scores from the final run
Results:
java Rifter: 9 match wins (45 total bout wins)
java EvadeBot: 10 match wins (44 total bo... |
What is some of the coolest/best/worse abuses of CSS?
For example, these shapes, or using multiple box-shadows to make pixel art.
popularity-contest ending on 16/04/14.
|
This challenge asks you to draw the Eiffel Tower in 3D using different ASCII characters to represent the different sides, similar to this cube:
@@@
@@@@@@@@@
@@@@@@@@@@@@@@@
x@@@@@@@@@@@@&&
xxx@@@@@@@@&&&&
xxxxx@@@&&&&&&&
xxxxxx&&&&&&&&&
xxxxx&&&&&&&
xxx&&&&
x&&
Here is a picture of the Eiffel Tower ... |
The task is to make a function which returns random number, no build in functions allowed, returned value should be random or pseudo-random and no sequence allowed, no matter what the formula is and how scattered values are.
To simplify task, returned value should be 32-bit integer or float from range [0; 1)
It is code... |
Context: We are working on a complex image drawing program to produce mugs, t-shirts, and so on. Here is an example of such function
However, we are facing the following problem: Random generated functions are mostly white and black (where black is close to zero and white close to infinity). The idea of this contest i... |
It's time for some quines! Well, sort of. This challenge is to create the smallest program that could move around in memory, i.e. if a program is resident in 2000:0100, the program should move to say, memory address be7a:3470.
Rules
The memory address to move in should be pseudorandom.
It's still valid if it's a mov... |
Syntax
~ not
/\ and
\/ or
t true
f false
P, Q, FISH, etc: variables
(Operators are given in order of precedence)
Introduction
Some boolean formulae can be changed to different forms to make them shorter. For example, the formula
~(~P /\ ~Q)
can be changed to the shorter form
P\/Q
while the formula
P \/ ~P
can be cha... |
A troll has captured you and is forcing you to write malware (defined as a program that damages the computer that runs it). The troll can read and understand code, but is not so good at spotting bugs.
Your goal is to write a program that:
Looks like malware; i.e., a beginning programmer reading the code will be convin... |
Introduction
The rain finally subsided. Most of humanity drowned due to a bug in @user12345's code. Survivors are scattered across a worldwide archipelago. Radio communication is up, and humanity is poised to thrive once more. For no reason whatsoever, zombie pirates have gathered at the Prime Meridian, and are sweepin... |
public int UndocumentedCode(int a, int b)
{
while (true)
{
a -= b;
b += a;
a = b - a;
if (b < a)
{
return b;
}
else
{
b += 1;
}
}
}
First figur... |
Write a program in language A which outputs a program in language B where:
Language A != Language B
The output is itself a solution to this question.
This is a popularity contest. If you want to define your own BNFs/grammars for this, feel free, but try not to make it too boring by doing so.
EDIT: The more languages... |
You know that your language's clock/time API's are broken and they are not reliable at all.
So you are not allowed to use any built-in API to access system time/date.
But you also know that your language's ability to perform date math, and retaining a date/time value in a variable are correct.
Write a program that prin... |
My robot has short circuited somehow and randomly run off somewhere from my lab!
Luckily, whenever he does this, his shut-down sequence initiates, giving him enough time to randomly turn and run in the direction its facing for five rounds before he switches off. His gyro and accelerometer functions are still relaying t... |
The Challenge:
In this question: Name the poker hand you had to take a five card poker hand and identify it. This question is similar, with two twists:
First, the output will be in all lower case. This allows for more golfing, as you don't have to worry about the capitalization of flush and straight
high card
one pair
... |
Write a plain TeX program that lists the first two hundred primes (in base-10 notation). Including external files/resources is not permitted. The output may be to the terminal, the log file, or the actual dvi/pdf file, at your option, but should be easily readable to a human; in particular, there must be some delimiter... |
In project management there's a method, called the critical path method, that is used for scheduling activities and for determining which activities' timings are crucial (i.e. critical) and for which activities the schedule offers a timing tolerance.
Your program's task is to order a set of activities chronologically a... |
Introduction
You are alone on an island. The remainder of humanity is dead (probably due to the bug in user12345's code). The Zombie Pirate Horde has reached your island, and they are endless. It's time to kick ass or chew bubble gum, and you're all outta bubble gum.
Problem
Our doomsday scenario is described by 2 inte... |
Imagine you are working on a 3D adaptation of the classical video game Asteroids. Your task is to write an algorithm that can create a random 3D asteroid.
This is a popularity contest, not code golf. Write nice code and create interesting results. Add other cool features if you want.
Rules:
Your algorithm must actuall... |
You are too make a program that take an integer as the input and outputs the first what ever that number was of the look and say sequence.
For example:
$ ./LAS
8
[1,11,21,1211,111221,312211,13112221,1113213211]
The exact way you output the list is unimportant, as long as users can distinctly see the different numbers ... |
4, 8, 15, 16, 23, 42
Write a program that outputs this sequence of numbers infinitely. However, The Numbers must not appear in your source code anywhere.
The following is not a valid Java program to output The Numbers because The Numbers appear in its source code:
class TheNumbers {
public static void main(String[]... |
You and a friend walk into a bar. The bartender treats you well, so you decide to tip him. So you pull out your trusty pocket computer and write a quick program to calculate a tip for you since it has no built in calculator. But wait! Your operator keys are broken! Your task is to calculate a 20% tip for any given inpu... |
Finding primes is a programming rite of passage and very frequently the first serious program someone creates (usually with trial division).
But primes alone are already worn out. A next far more interesting thing is to get the prime gaps: the so-far-longest gaps between consecutive primes. These are quite rare and "pr... |
Your task is simple. Determine if one string equals the other (not address, the value) without the use of equality operators (such as ==, ===, or .equal()) or inequality (!=, !==) anything similar for other languages. This means anywhere! You may not use these operators anywhere in the code. You may however, you use to... |
Input will be one or more space separated characters followed by a long string on STDIN or as an argument when called from the shell.
a C
WAtcIaElCpVqDRavOUejlgumcRCpfIWlaRFZpIoPYsWjsBSdlYfitfAPHpemiLpjaHheUGpFVQoZCnSCFgvpVzcoibdffoPRoJJwLIjVicPCdcvITXaQDjtMgrxQMZCkZNFmNqwGQYaSyPpdLOkAVHGVoVBiIksZCQHEaIxcRGwpIAmlChuhGE... |
Introduction
You belong to a council which oversees the destruction of corrupted worlds. When the council assembles, a single vote is taken. The ballot lists all nominated worlds. One is ultimately destroyed each time the council meets.
Due to a bug in user12345's code, the council recently flooded and then sent pirate... |
All these functional languages that return the same value every time a function is called give me a headache.
Your task is to write a function that returns something different every time it is called.
Here are the rules:
Your function must continue to return something different every time it is run
It must return a d... |
You are to write a program that does one of the following.
Only displays "Hello World" does nothing else
Quits and nothing else (no output, no errors.)
Takes one line of input, parses it as an integer, displays the first that many primes (or gives a nice error if it is given input that can't be parsed as an integer, o... |
Your goal is to calculate the sum of Fibonacci series from n th term to m th term (including both terms).
No use of / * % or mathematically what they are in your language of choice.
No use of special functions or code language specialized in doing so !
You have to produce the series yourself and not by any special fun... |
So I'd like you to attempt to generate Rorschach images like the below image:
Here is a link to further inspiration.
This is a popularity contest, but I will say that colours are likely to be more popular than black and white, as well as textures.
Rorschach images are created by folding paper with ink on so one criter... |
Your goal is to write a program / script which "converts" real images into ascii art.
General:
Your program will get a path to a image file over stdin or as parameter (whatever you prefer). The format will be jpeg.
It should "convert" it to ascii art and save it to the harddrive.
The image will be in grayscale. You don... |
The Setup
Jim the student who attempts to use Stack Overflow to do his homework has asked how to get his program to say "Hello World" in under 100 lines of code, you decide mere mortal trolling is not enough...
The Challenge
You need to provide Jim with a program less than 100 lines long that outputs a satisfactory ans... |
We already generated Minesweeper fields, but someone really has to sweep those generated mines before PCG blows up!
Your task is to write a Minesweeper Solver that is compatible with a slightly modified version of the accepted solution of “Working Minesweeper” (actions are separated by spaces to allow for larger fields... |
2048 is an incredibly fun and addictive game in which the goal is to create a tile with 2048 on it.
Here's a short description of the game:
Pressing an arrow key will slide all the blocks in the stage in that direction. For example, if x represents a block, and you pressed the up arrow in this case:
...x
.x..
..x.
xx.... |
Happy π Day. The goal of this question is to calculate the area for a circle of radius 3, where A = πr².
The catch is that you have to use the constant π that is defined in a different language than the one you are programming in. For example, you can write a C program that uses Fortran's MATH::PI, or a Python program... |
Write the shortest code that traverses a directory tree and outputs a flat list of all files.
It should traverse the whole directory tree
The order in which it enters sub-directories doesn't matter
The directories should not be output
The output should be a plain list — the definition is flexible, but it shouldn't con... |
Explanation
¡Hola! For those of you who don't take Spanish, a verb is conjugated based on the person who does the action. Here's a chart:
English Spanish
I Yo
You Tú
He Él
She Ella
You (formal) Uste... |
Write a program which gets a string as its input, and counts the number of alphanumeric and non-alphanumeric characters in it. It has to display its result like this:
input: http://stackexchange.com
output: 20 + 4 = 24
The catch is, your source code has to have the same number of alphanumeric characters as non-alphanum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.