rosetta-stone

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

丶灬走出姿态 提交于 2020-02-12 08:36:25
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. 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 be done in any other major language today as well (mostly C#, Java, etc).

Code Golf - Banner Generation

那年仲夏 提交于 2020-01-10 06:59:28
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. When thanking someone, you don't want to just send them an e-mail saying "Thanks!", you want to have something FLASHY: Input: THANKS!! Output: TTT H H AAA N N K K SSS !!! !!! T H H A A NNN K K S !!! !!! T HHH AAA NNN KK SSS !!! !!! T H H A A N N K K S T H H A A N N K K SSS !!! !!! Write a program to generate a banner.

Code Golf: Leibniz formula for Pi

不羁岁月 提交于 2020-01-10 06:28:08
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I recently posted one of my favourite interview whiteboard coding questions in "What's your more controversial programming opinion", which is to write a function that computes Pi using the Leibniz formula. It can be approached in a number of different ways, and the exit condition takes a bit of thought, so I thought it

Create, sort, and print a list of 100 random ints in the fewest chars of code

▼魔方 西西 提交于 2019-12-31 09:00:07
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. What is the least amount of code you can write to create, sort (ascending), and print a list of 100 random positive integers? By least amount of code I mean characters contained in the entire source file, so get to minifying. I'm interested in seeing the answers using any and all programming languages. Let's try to keep

Code Golf: Lights out

爱⌒轻易说出口 提交于 2019-12-20 16:49:17
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. The challenge The shortest code by character count to solve the input lights out board. The lights out board is a 2d square grid of varying size composed of two characters - . for a light that is off and * for a light that is on. To solve the board, all "lights" have to be turned off. Toggling a light (i.e. turning off

Code Golf: Frobenius Number

拥有回忆 提交于 2019-12-20 12:18:46
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. 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 the Chicken McNugget TM sizes [6,9,20] the Frobenius number is 43, as

Code Golf: Playing Tetris

喜夏-厌秋 提交于 2019-12-20 08:08:52
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. The basics: Consider the following tetrominoes and empty playing field: 0123456789 I O Z T L S J [ ] [ ] # ## ## ### # ## # [ ] # ## ## # # ## # [ ] # ## ## [ ] # [ ] [==========] The dimensions of the playing field are fixed. The numbers at the top are just here to indicate the column number (also see input). Input: 1

Code Golf: Four is magic

核能气质少年 提交于 2019-12-18 10:02:14
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. The puzzle A little puzzle I heard while I was in high school went something like this... The questioner would ask me to give him a number; On hearing the number, the questioner would do some sort of transformation on it repeatedly (for example, he might say ten is three ) until eventually arriving at the number 4 (at

Code Golf: Running Water

霸气de小男生 提交于 2019-12-18 10:01:32
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. The challenge The shortest code by character count to identify and mark water depressions in the ASCII representation of a land from input. Input will be an ASCII representation of a landscape, having hills, valleys and flat lands. The program should simulate what the landscape would look like if if was flooded -

The Skyline Problem‍​​

大城市里の小女人 提交于 2019-12-18 09:54:26
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I just came across this little problem on UVA's Online Judge and thought, that it may be a good candidate for a little code-golf. The problem: You are to design a program to assist an architect in drawing the skyline of a city given the locations of the buildings in the city. To make the problem tractable, all buildings