-3
votes
0answers
29 views
Need help on what programming course i should study [on hold]
i just finish High School, and i find computer programming interesting, but i actually don't know which course on the programming i should study, i have being doing lot of research online and ...
11
votes
4answers
185 views
This question has its ups and downs
Input will consist of the following characters:
^: Go up one
v: Go down one
▲ or k: Go up two
▼ or j: Go down two
For example, the following input:
^^▲^v▼▲^^v
would produce the following ...
-2
votes
0answers
40 views
Recursive(?) algorithm design help [on hold]
I realise that this is off topic but it strikes me that it might be the type of thing that might do well here...
I have a requirement to allow my end users to input formula much like a spreadsheet. I ...
13
votes
0answers
105 views
Telling time in French
Bonjour, PPCG ! Quelle heure est-il ? This means what time is it in French, for that is exactly what this challenge is about.
Telling time in French (at least formally) is a bit different from ...
3
votes
7answers
188 views
Make me a scrolling marquee
Introduction
Remember the roaring 80's? I mean, you know, like 30 years ago? No cell phones, no internet, no ATM's, fluorescent clothing (what was that?!) and scrolling marqee's! No, no, no! Not the ...
57
votes
31answers
2k views
Source code ecological footprint
You've just been hired by a German car manufacturing company. Your first task, as an engineer, is to write a program that computes the ecological footprint of ASCII strings.
The ecological footprint ...
8
votes
0answers
132 views
The Doughnut Shop™
Being short of cash, you have signed up to build donuts for The Doughnut Shop™, the biggest digital doughnut company in the world, mostly because they sell every size of doughnut imaginable.
Now, ...
8
votes
0answers
148 views
Counting Cunningham chains
Prime numbers have always fascinated people. 2300 years ago Euclid wrote in his "Elements"
A prime number is that which is measured by a unit alone.
which means that a prime is only divisible by ...
1
vote
1answer
90 views
Palandrome-ish code [on hold]
Create a program that does the same thing forwards and backwards, in different languages. “Different languages” does not include different versions of the same language.
Challenge
This program can ...
9
votes
1answer
183 views
Maze generating one liner
The famous C64 basic one liner
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
prints a maze of slashes and backslashes.
\\/\\\//\/\////\\/\/
\/\///\\///////\//\/
/\\\//\//\////\\//\\
\////\//\//\/\\\\\\/
...
11
votes
3answers
443 views
Confidant Numbers
Confidant Numbers
Let x be an integer of an arbitrary base, such that D is an array of its digits. x is a Confidant Number if, for all n between 1 and the length of D:
D[n+1] = D[n] + D[n-1] + ... + ...
36
votes
64answers
3k views
1, 2, Fizz, 4, Buzz
Introduction
In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...
-7
votes
5answers
265 views
A Perplexing Puzzle
The Challenge
Create a program or function that takes no input, and outputs (or returns):
I'm a programming paradox — no I'm not.
Without using a character twice in any string, or digit twice in ...
5
votes
0answers
48 views
Dependency Graph Visualization
The goal of this challenge is to write a program that visualizes a dependency graph in the form of a tree.
While "dependency graph" in this context means nothing more than a directed graph, the ...
21
votes
6answers
1k views
Heterograms, Palindromes, oh my!
(First challenge, please let me know if there are any problems with it.)
A heterogram is a word where no letter of the alphabet occurs more than once, and a palindrome is a phrase that is the same ...
12
votes
6answers
469 views
Implement functional programming paradigms
Your company is just getting started on a project, and for the first time you decided to go use a functional programming code-style. However your boss is really diffident and doesn't want to use ...
12
votes
7answers
733 views
The Euclidean Algorithm (for finding the greatest common divisor)
The Challenge
Write a program or function that takes two input integers, i and j, and outputs their greatest common divisor; calculated by using the Euclidean algorithm (see below).
Input
Input ...
8
votes
1answer
160 views
Karel J. AlphaBot Sequence Generator
Scores
This section will be filled in as submissions are entered.
Normal
1. name, score
2. name, score
3. name, score
4. name, score
5. name, score
Bonus Round
1. name, score
2. name, score
3. ...
35
votes
11answers
3k views
Just repeat yourself
Write a program that outputs
Do not repeat yourself!
Your program code must respect the following constraints :
its length must be an even number
each character that is in position 2n (where n ...
25
votes
18answers
1k views
Right-align text
Your job is to take a string input and a number and align the string to the right, making the width of the text the number. When a line is too long, break it and put the rest on the next line, ...
12
votes
3answers
211 views
Generate a Monotonic Function
Overview
In this challenge, your task is to randomly generate a monotonic mathematical function between two sets.
Input
Your inputs are two positive integers s and n.
After getting these inputs, ...
35
votes
10answers
3k views
Let us play the ocarina
As we all know, the Zelda series are one of the best game series ever made. In honor of that, let us play some songs on the ocarina.
Challenge:
Write a program which, given a song, outputs the score ...
4
votes
3answers
239 views
Write two programs that compresses and decompresses data
Challenge:
Create a program that compresses a semi-random string, and another program that decompresses it. The question is indeed quite similar to this one from 2012, but the answers will most ...
17
votes
0answers
321 views
Seriously, GolfScript, CJam, or Pyth?
Some time ago, the following question was asked: GolfScript, CJam, or Pyth?
Based on the title only, I thought that it would be a very nice challenge, but unfortunately, it turned out to be a question ...
-4
votes
0answers
116 views
Output All Possible Combinations following some rules! [on hold]
The code must output all possible combinations of 6 numbers between 1 and 75 in whatever way you prefer, STDOUT PRINT or .TXT
Example:
01,02,25,26,50,51
03,04,27,28,52,53
05,06,29,30,54,55
...
9
votes
5answers
1k views
Base85 Encoding
The Challenge
Write a program that can take an input of a single-line string containing any ASCII printable characters, and output the same string encoded in Base85 (using a big-endian convention). ...
4
votes
2answers
233 views
The Stack Exchange Site List [duplicate]
Currently, the Stack Exchange network has nearly 150 sites. These sites are as follows:
Computer Graphics
Portuguese Language
elementary OS
Open Source
Law
Русский язык
Mythology
Health
Stack ...
8
votes
0answers
77 views
Find the Chemistry of a name [duplicate]
We all have knowledge of the periodic table, since our days in school.
Something most of us have often tried to do is to spell out your name using elements of the table.
Your challenge is to do ...
39
votes
9answers
2k views
Molecules to Atoms
The Challenge
Write a program that can break down an input chemical formula (see below), and output its respective atoms in the form element: atom-count.
Input
Sample input:
H2O
Your input ...
8
votes
0answers
230 views
Stack to the Future [on hold]
Welcome Back to the Future's fans and enthusiastic codegolfers.
Let's begin with this simple statement : Marty arrives in 2015 in one month (On october the 21st !). Therefore I propose we use the ...
16
votes
6answers
2k views
Draw a Houndstooth Pattern
Write a program or function that takes in two positive integers, a width and a height, and draws an ASCII art houndstooth grid pattern with those dimensions using this 25×26 text grid as the ...
0
votes
8answers
759 views
Generate random UUID
I need a UUID. Your job is to generate one.
The canonical UUID (Universally Unique IDentifier) is a 32-bit hexadecimal number with hyphens inserted in certain points.The program should output 32 hex ...
0
votes
2answers
154 views
Mirror programs [on hold]
Here is your task, should you choose to accept it: Output (through STDOUT, or whatever is most convenient) some n by m ASCII art that has at least one line of symmetry and is non-empty. Example:
HiiH
...
25
votes
15answers
2k views
Monday Mini-Golf #1: Reverse Fibonacci Solver
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday.
A Fibonacci-like sequence is obtained using the same method as the famous Fibonacci sequence; that is, each ...
-1
votes
0answers
134 views
The laser torrents maze [on hold]
This question is not mine, it was posted as part of the facebook hacker cup qualification round. However, I would like to see how you guys are going to approach this problem.
Problem statement:
...
-5
votes
0answers
34 views
programme code for java netbeans [on hold]
I want to connect a jFrame form another jFrame in Netbeans 8.0.2 and to save the data given by user in the first jFrame and to use that in another jFrame
In first jFrame I desinged a form U.I. (which ...
15
votes
1answer
236 views
Counting groups of a given size
Groups
In abstract algebra, a group is a tuple (G, ∗), where G is a set and ∗ is a function G × G -> G such that the following holds:
For all x, y, z in G, (x ∗ y) ...
-1
votes
0answers
49 views
Wrong Test case answer [closed]
for the problem https://www.hackerrank.com/challenges/chocolate-feast
below is the code I wrote:
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
...
19
votes
13answers
2k views
Time to adjust some prices!
I'm sure you know about the $9.99 price scheme, instead of using $10. Well, in your new job as a sys admin at a large retail store, they want prices to adhere to a similar scheme:
All prices are in ...
1
vote
5answers
483 views
Isn't the point of math to just use numbers?
Write a program that converts a mathematical expression to words, evaluates the expression, and prints how the equation would be spoken aloud.
Input
The input must only contain numbers and the ...
21
votes
9answers
2k views
The FizzBuzz-ish String matcher
Say that you have a string like this:
abaabbbbbaabba
Count the number of times that a specified character appears in the input string, but only if the character appears only once in a row. For ...
30
votes
5answers
732 views
Break tabs in half
Holy wars have been fought over spaces vs. tabs. (And of course spaces, being
objectively superior, won.) —Alex A.
Some people still refuse to accept that
which is clearly supreme. You've just ...
13
votes
0answers
215 views
Bob the Bowman!
Bob the Bowman
o
/( )\ This is Bob.
L L Bob wants to be an archer.
#############
.
/ ...
-3
votes
0answers
87 views
Creative Subliminal Messages [closed]
you have an Upcoming computer science test that you want to ace. the Prompt is to write a program that will sort and print an array of Various numbers and the mean of those numbers. easy enough. ...
34
votes
21answers
2k views
Compute the Digit Difference Sum of a Number
Consider taking some non-negative integer such as 8675309 and computing the absolute values of the differences between all the pairs of neighboring digits.
For 8675309 we get |8-6| = 2, |6-7| = 1, ...
1
vote
6answers
313 views
Bounce Dynamics
The Challenge
Write a program that can calculate how many times and how long a ball will bounce based on a few input variables.
Input
There are three variables that will be passed. You can accept ...
0
votes
1answer
182 views
The Truck Problem [closed]
I am a teacher who was given a problem a few years ago. Every year since I have given it to my advanced students as a bonus assignment, but in ~10 years only 8 solved it, each with a slightly ...
10
votes
4answers
249 views
Avast, ye scallywags!
Blackbeard was an English pirate of the early 18th century. Although he was known for looting and taking ships, he commanded his vessels with the permission of their crews. There are no accounts of ...
14
votes
4answers
337 views
Counting the Endpoints of an ASCII Art
You should write a program or function which receives a string representing an ASCII art as input and outputs or returns the number of endpoints in the input.
The input will consist of the characters ...
21
votes
12answers
898 views
A Sine of Greatness
Introduction
Everyone's heard of sine (sin), cosine (cos), tangent (tan), cotangent (cot), secant (sec), and cosecant (csc). Nearly every angle has them.
Far less known, or remembered, are the ...