Questions tagged [rosetta-stone]

Encouraging users to solve a challenge using as many different languages as they know. The end goal is to demonstrate how the same challenge is accomplished in different programming languages.

66 questions
13
votes
15 answers

Code Golf: MSM Random Number Generator

The challenge: The shortest code by character count that will generate a series of (pseudo)random numbers using the Middle-Square Method. The Middle-Square Method of (pseudo)random number generation was first suggested by John Von Neumann in 1946…
Vivin Paliath
  • 94,126
  • 40
  • 223
  • 295
12
votes
9 answers

Code Golf: Frobenius Number

Write the shortest program that calculates the Frobenius number for a given set of positive numbers. The Frobenius number is the largest number that cannot be written as a sum of positive multiples of the numbers in the set. Example: For the set of…
Landei
  • 54,104
  • 13
  • 100
  • 195
12
votes
13 answers

Code Golf: Quickly Build List of Keywords from Text, Including # of Instances

I've already worked out this solution for myself with PHP, but I'm curious how it could be done differently - better even. The two languages I'm primarily interested in are PHP and Javascript, but I'd be interested in seeing how quickly this could…
Sampson
  • 265,109
  • 74
  • 539
  • 565
10
votes
7 answers

Code golf: "Color highlighting" of repeated text

(Thanks to greg0ire below for helping with key concepts) The challenge: Build a program that finds all substrings and "tags" them with color attributes (effectively highlighting them in XML). The rules: This should only be done for substrings of…
RubiCon10
  • 1,199
  • 2
  • 13
  • 15
10
votes
34 answers

Array Searching code challenge

Here's my (code golf) challenge: Take two arrays of bytes and determine if the second array is a substring of the first. If it is, output the index at which the contents of the second array appear in the first. If you do not find the second array in…
RCIX
  • 38,647
  • 50
  • 150
  • 207
0
votes
1 answer

Need help deconstructing RosettaStone Huffman Code

I'm taking a class in C with a couple of friends. We're doing a project on Huffman Encoding and I am trying to understand the Rosetta stone version of the code. I think I've figured most of it out, but I don't understand a couple of…
1 2 3 4
5