Linked Questions

44
votes
50answers
3k views

Output integers in negative order, increase the maximum integer everytime

Main task Your task is to print out integers in descending order, starting from 1, and increasing as you keep hitting 1 again, up until the given input is reached, then, print out the rest until you ...
36
votes
34answers
7k views

Press any key to continue

Your task is to create a program that will display the following text, wait for the user to press a key (it is okay to ignore keys like ctrl, ...
19
votes
22answers
1k views

Calculate the n-th iterate of a polynomial for a specific value; fⁿ(x)

Given a polynomial function f (e.g. as a list p of real coefficients in ascending or descending order), a non-negative integer n, and a real value x, return:    f n(x) i.e. the value of f (f (f (…f (...
13
votes
11answers
2k views

Graphical Representation of Koch Snowflake

Generate a Koch Snowflake A Koch snowflake is a triangle that for each n, another equilateral point is added in the middle of each side: http://en.wikipedia.org/...
20
votes
12answers
1k views

Tips for golfing in MATL

MATL is a golfing language created by Luis Mendo. MATL has proven to be highly competitive, often beating submissions in other golfing languages such as Pyth, CJam and Jelly. What are some useful ...
16
votes
12answers
2k views

Find the Fibonacci Patterns

You are probably familiar with the Fibonacci sequence where the first two terms are 0, 1 (or sometimes 1, 1) and every term ...
14
votes
12answers
2k views

Tips for golfing in MATLAB

What general tips do you have for golfing in MATLAB? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to MATLAB (e.g. "remove comments" is ...
34
votes
6answers
4k views

Python workarounds for assignment in lambda

This is a tips question for golfing in Python. In Python golfing, it's common for a submission to be a function defined as a lambda. For example, ...
19
votes
9answers
1k views

Be there or be square!

Everybody has heard of the phrase "be there or be square". So I thought it was time for a challenge about it. Input You will take a full absolute directory address as text as input via STDIN or ...
15
votes
3answers
1k views

How to swap elements in a vector using an anonymous function in Octave?

Swapping two elements in a vector/matrix is very simple in Octave: x='abcde'; x([4,1])=x([1,4]) x = dbcae Unfortunately, I have yet to find a way to do this ...
16
votes
8answers
846 views

Transform a matrix

Write a program or function where a matrix A (maximum value of dimensions of the matrix is 100) is transformed to a new matrix B. Each element of the new matrix B is the sum of the positive neighbors ...
16
votes
9answers
578 views

Intermediate String Array Reflection

Let's start by re-defining a reflection of a character in a 2-d array of characters: Given a square 2-d array of characters with distinct lowercase alphabetical letters, define a reflection of a ...
12
votes
3answers
364 views

Natural Pi #2 - River

Goal Given an string with a train of hashes, calculate its total length and divide by the distance from start to finish. Simulation What are we simulating? According to this paper, the ratio of the ...