All Questions
-1
votes
0answers
41 views
Tips for King of the Hill challenges [migrated]
Inspired by this question, what are some tips you guys have for creating king of the hill challenges? What are some things to keep in mind in the planning and implementing of the rules and the ...
0
votes
0answers
21 views
A cycle of quine-like programs [duplicate]
This question asks you to write n programs, such that program 1 outputs program 2, program 2 outputs program 3, ... program n-1 outputs program n and program n outputs program 1.
However, not all of ...
5
votes
2answers
86 views
Permutations of n digits with no repeating digits
Your program must take an input (n for the purpose of description) and output all permutations of a number that is n digits long with no repeating digits, where each of the digits preceding and ...
21
votes
4answers
430 views
Snakify a String
A snakified string looks like this:
T AnE eOf ifi ing
h s x l A k e r
isI amp Sna dSt
Your Task
Take a string s and a size n, then output the snakified string. The inputs ...
3
votes
1answer
136 views
Simulate Cookie Clicker
Intro
Cookie Clicker is a popular browser game in which the player has to click a cookie to gain... Cookies!
The player can buy upgrades which will automatically farm cookies for you. Sometimes a ...
20
votes
13answers
1k views
Are the brackets fully matched?
You must write a program or function that takes a string of brackets and outputs whether or not that string is fully matched. Your program should print a truthy or falsy value, and IO can be in any ...
-7
votes
0answers
38 views
ASCII to binary/hex/oct and back [on hold]
Your mission is simple:
Take file or stdin input of ASCII, and convert to binary. When the input is binary, convert to ascii. The program should be able to take stdin or file input, and output to ...
17
votes
8answers
765 views
Rectangle Detection
Write a program or function that takes in a multiline string of 0's and 1's. No other characters will be in the string and the string will always be rectangular (all lines will have same number of ...
3
votes
1answer
24 views
Tips for golfing in Racket / Scheme
What general tips do you have for golfing in Racket / Scheme? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Racket / Scheme (e.g. ...
1
vote
1answer
85 views
Write a narcissist program! [duplicate]
A narcissist program is simple. It is related to a quine.
If the input is equal to it's source code, it prints a truthy value, if not it prints a falsy one. That is it.
Rules:
It can't read it's ...
10
votes
3answers
133 views
Tips for King of the Hill bots
What general tips do you have for creating a bot to participate in a King of the Hill challenge? What strategies do you use to go from considering the challenge to creating your bot? What data ...
6
votes
0answers
222 views
Where will the cat go?
A nearly massless cat is dropped in space (don't worry, with a space suit and everything) at the point (x, y, z) with velocity (vx, vy, vz). There is an fixed, infinitely dense planet (with volume of ...
25
votes
18answers
1k views
Palindromizing the strings
Introduction
For the ones who don't know, a palindrome is when a string is equal to the string backwards (with exception to interpunction, spaces, etc.). An example of a palindrome is:
abcdcba
If ...
-22
votes
0answers
90 views
If you can find three positive integers k1,k2and k3 as below I shall disprove FLT [on hold]
If any one could find three positive integers k1,k2 and k3 as attached equation, then I shall disprove FLT. Other wise if there is no such equation exist, FLT is true by 3 page proof.
-8
votes
0answers
43 views
Minimum Permutations for a polindrome [on hold]
Can someone help me with an algorithm which displays the minimum permutations of letters to become a polindrome?
11
votes
1answer
290 views
A tricky infinite sum (or…to infinity and beyond)
This challenge is to write fast code that can perform a computationally difficult infinite sum.
Input
An n by n matrix P with integer entries that are smaller than 20 in absolute value. When testing ...
38
votes
30answers
2k views
Stretch the word
The input is a word of lowercase letters not separated by whitespace. A newline at the end is optional.
The same word must be output in a modified version: For each character, double it the second ...
29
votes
2answers
383 views
Help me sort my socks!
I have a pile of clean socks that I want to sort into pairs. Unfortunately, I can only take socks from either end of the pile, not the middle. Further, I can only remove socks from the pile a matching ...
7
votes
0answers
99 views
Make a Strawpoll
Strawpolls are great, and we use them in chat all the time for getting opinions on things. But they're kinda annoying to make since you need a webbrowser to make them, and everyone knows that I access ...
-10
votes
0answers
53 views
website for lowest bidding auction [on hold]
Create a website to auction things. The lowest unique bidder should be considered as the winner. Your website should contain an admin login and user login.
-8
votes
0answers
38 views
solving problem step by step, limit x to inf, limit x to 0 and limit x to -1 [on hold]
lim x to inf ((x^4)-3x)/(-2x+5) solving step by step
lim x to 0 ((-(cosx)^2)/4x^2) solving step by step
lim x to -1 ((x+1)/((6(x^2)+3)^1/2)+3x) solving step by step
9
votes
12answers
1k views
Double-duty quine
Write a program that will output its own source code when run, and nothing else. Seems easy, right?
The catch is that when the source code is reversed, your program must output "Hello, World!" ...
21
votes
24answers
2k views
The plus-minus sequence
The plus-minus sequence
The plus-minus sequence is one that starts with two seeds, a(0) and b(0). Each iteration of this sequence is the addition and subtraction of the previous two members of the ...
24
votes
3answers
551 views
Clean the muddy quartata-fish
This challenge is in honor of the Rookie of the Year category winners of Best of PPCG 2015: muddyfish (for I'm not the language you're looking for!) and quartata (for Implement a Truth-Machine).
...
18
votes
3answers
164 views
Highest score on the field
Introduction
Let a field be a rectangle filled with only the characters - and [0-9]. An example of a field is:
11-011123
111-010--
0010---01
111-01234
You see that this field has been separated ...
8
votes
7answers
553 views
Read a crossword
Inspired by this question about packing into this format.
Occasionally I see a completed crossword and being as I am, I can't be bothered to find out what the solutions to the clues actually were.
...
2
votes
1answer
163 views
Shortest code for key-logger
Okay, I propose a shortest-key-logger challenge. As explained by the gentleman at "Are key-logger questions allowed?", strict rules have to be imposed in order to make this challenge valid for PPCG.
...
15
votes
3answers
273 views
Go to opposite corner of rectangle in all directions - Harder
This is essentially the same thing as this question, except harder. You are again to write a program that gets from the lower-left corner of a rectangle to the upper-right corner. However, this time ...
2
votes
0answers
170 views
Shortest code to secure wipe a disk
As you can tell from this question and my previous one, I am determined to kill my SSD.
Let's write the shortest code to perform a simplified variant of the DoD 5220.22-M Wipe Method with only two ...
26
votes
13answers
1k views
The Arithmetic Derivative
The derivative of a function is a cornerstone of mathematics, engineering, physics, biology, chemistry, and a large number of other sciences as well. Today we're going to be calculating something only ...
6
votes
1answer
130 views
Validate a Wikipedia page name [on hold]
Wikipedia has several restrictions on an article's title. I summarize them here:
It may not be empty.
It may not begin with a lowercase letter. A character is considered lowercase if it has an Ll ...
-4
votes
3answers
169 views
Evaluate an infinite sum [on hold]
This challenge is write code that can perform an infinite sum to high precision.
Task
Your code should compute
sum(exp(-x^2), x = -infinity..infinity)
to 50 decimal places.
The answer should ...
0
votes
0answers
86 views
Write an interpreter for my new esoteric language StreamFlow [on hold]
I don't even know why I called it that...
So, I thought up of an idea for an esoteric language, and today, it's your task to write an interpreter! This is code-golf.
The language specification is ...
16
votes
2answers
421 views
Draw a random hexa-glyph
The above image is called a hexa-glyph. Hexa-glyphs are some cool patterns I made up while doodling during my DiffEq class. Here's how you make one:
Consider the following set of points, shaped ...
13
votes
14answers
618 views
Optimal solution to go to opposite corner of a rectangle
Your job is to write a program that finds the optimal number of moves it takes to get from the lower-left corner of a rectangle to the upper-right corner directly opposite.
Your program will accept ...
-4
votes
0answers
58 views
JAVA code to calculate marks of lowest ID student [on hold]
Marks of Lowest ID Student:
The input is being read in from a file called input.txt, in this format:
22|Data Structures|45
23|English|52
22|English|51
26|Data Structures|72
23|Data Structures|61 ...
-4
votes
0answers
37 views
Exercism (javascript) palindrome-products requirements [on hold]
I'm working on the exercism.io javascript puzzle palindrome-products and I'm having a hard time understanding the requirements of the first test in the test-suite.
As I understand the first test for ...
14
votes
7answers
709 views
Turn a string into a windmill
The code on this site is rapidly being depleted. We need to invest in renewable strings. So you must write a program that takes a string and converts it into a windmill.
The Challenge
Let's take a ...
0
votes
0answers
78 views
Create a Calculator in the least amount of Bytes [on hold]
Create a program that has a working Calculator
Make it with a graphical user interface (meaning no batch)
It should support at least + - * / ^ ± 1/x MC MS MR M+ operations
Here is my try: (6,648 ...
10
votes
4answers
244 views
Find the shortest way to advance a counter to a certain number
I have a counter. It's a small device that looks like this:
The display goes from 0000 to 9999. It has a little push-button at the top that increases the count by 1, and a little knob at the right ...
7
votes
3answers
112 views
Ordering words to fit in a given string
Given a string of letters and a set of words, output an ordering of the words so
that they can be found in the string by dropping letters that are not needed.
Words may occur more than once in the ...
-5
votes
0answers
71 views
Write the ugliest Javascript conceivable [on hold]
After being a C++ programmer who has never used js, being assigned js projects for 5 months, I have finally snapped and realized js can be made so ugly its an art.
var t2b= {id:0};
...
9
votes
4answers
256 views
Code a code page
Introduction
A code page maps integer values to a specific character. We can visualize a code page like this:
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| | 0 | 1 | 2 | ...
5
votes
3answers
175 views
Write an interpreter for my new programming language
I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, all initialized to zero, has one instruction pointer, and one "bit index".
...
3
votes
4answers
97 views
Is this a Lucas number? [duplicate]
Write a program or function that takes an input greater than or equal to 2. It should output a truthy or falsy value corresponding to whether the input is a Lucas number or not. You may take input ...
14
votes
11answers
428 views
Ravenity of Cube Distance Numbers
Inspired by this Numberphile entry
Background
The cube distance numbers of an integer n are defined here as the set of integers that are x³ distance away for a given x. For a simple example, with ...
-6
votes
0answers
35 views
building an adding machine [on hold]
i'm having real problems how to build an adding machine.
its supposed to have 5 inputs and 3 outputs.
output should give a sum of positive signals (all binary, so with 2 positive inputs it should ...
36
votes
26answers
7k views
Shortest code for infinite disk I/O
(Just open 50 tabs in Google Chrome :D (just kidding, no you can't))
Shortest code for infinite disk I/O any language, C# example:
using System.IO;
namespace FileApp {
static class Program {
...
55
votes
19answers
3k views
Tweetable hash function challenge
In this code-challenge you will write a hash function in 140 bytes1 or less of source code. The hash function must take an ASCII string as input, and return a 24-bit unsigned integer ([0, 224-1]) as ...
0
votes
0answers
56 views
Output your used source code in reverse [duplicate]
I'm new to this stackexchange, but I must say I am very impressed by the knowledge of some here, and the original codegolf answers for some questions.
I'm not even sure if the following is possible, ...