code-golf

Code Golf: 1x1 black pixel

感情迁移 提交于 2019-12-03 06:36:41
问题 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. Recently, I used my favorite image editor to make a 1x1 black pixel (which can come in handy when you want to draw solid boxes in HTML cheaply). Even though I made it a monochrome PNG, it came out to be 120 bytes! I mean, that's kind of steep. 120 bytes. For one pixel . I then converted it to a GIF, which dropped the

How to generate a Mandelbrot with T-SQL?

廉价感情. 提交于 2019-12-03 06:18:44
问题 Learning a little about T-SQL, and thought an interesting exercise would be to generate a Mandelbrot set with it. Turns out someone already has (and recently, it appears). I'll let someone else post it as an answer, but I'm curious what optimizations can be made. Alternately, what would you do to make the code more readable? I'll select the most readable (yet reasonably compact) version as the accepted answer (too bad we don't have rep bounties yet!) unless someone really comes along with a

Async Google Analytics [Javascript Golf]

心已入冬 提交于 2019-12-03 05:51:16
问题 Unfortunately, this may not be a valid Code-Golf question as it is likely Javascript only; however, since this is likely to be the only useful-in-the-real-world code-golf contest I'm going to go ahead and post it. The Google Analytics Asyncronous Tracking snippet is used by many websites. The script goes a little something like this: <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); (function() { var ga = document

Code Golf: Word Search Solver

你。 提交于 2019-12-03 05:40: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. Note: This is my first Code Golf challenge/question, so I might not be using the correct format below. I'm not really sure how to tag this particular question, and should this be community wiki? Thanks! This Code Golf challenge is about solving word searches! A word search, as defined by Wikipedia, is: A word search,

Code Golf: Phone Number to Words

此生再无相见时 提交于 2019-12-03 05:39:51
Guidelines for code-golf on SO We've all seen phone numbers that are put into words: 1-800-BUY-MORE, etc. What is the shortest amount of code you can write that will produce all the possible combinations of words for a 7 digit US phone number. Input will be a seven-digit integer (or string, if that is simpler), and assume that the input is properly formed. Output will be a list of seven-character strings that For instance, the number 428-5246 would produce GATJAGM GATJAGN GATJAGO GATJAHM GATJAHN GATJAGO GATJAIM GATJAIN GATJAIO and so on..... Winning criterion will be code from any language

Code Golf: Triforce

两盒软妹~` 提交于 2019-12-03 05:30:00
问题 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. This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383 The Problem Assume the user gives you a numeric input ranging from 1 to 7. Input should be taken from the console, arguments are less desirable. When the input is 1, print the following: *********** ********* ******* ***** *** *

Code Golf: Validate Sudoku Grid

Deadly 提交于 2019-12-03 05:05:12
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. Learn more . Introduction A valid Sudoku grid is filled with numbers 1 to 9, with no number occurring more than once in each sub-block of 9, row or column. Read this article for further details if you're unfamiliar with this popular puzzle. Challenge The challenge is to write the shortest program that validates a Sudoku grid that might not be full. Input will be a string of 9 lines of 9 characters each, representing the

Code Golf: Towers of Hanoi

梦想的初衷 提交于 2019-12-03 05:04:43
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. Learn more . Rules The Towers of Hanoi is a puzzle, and if you are not very familiar with it, here is how it works: The play field consists of 3 rods, and x number of disks, each next one bigger than the previous one. The disks can be put on the rod, with these RULES : only one disk can be moved at once, and it must be moved on the top of another rod the disk must be taken from the top of a rod a disk can be moved

Code Golf: Numeric Ranges

て烟熏妆下的殇ゞ 提交于 2019-12-03 05:03:29
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. Learn more . Challenge Compactify a long list of numbers by replacing consecutive runs with ranges. Example Input 1, 2, 3, 4, 7, 8, 10, 12, 13, 14, 15 The input is guaranteed to be in ascending order and will not contain duplicates. Output 1 - 4, 7, 8, 10, 12 - 15 Note that ranges of two numbers should be left as is. ( 7, 8 ; not 7 - 8 ) Rules You can accept a sorted list of integers (or equivalent datatype) as a method

garble function contest

半腔热情 提交于 2019-12-03 05:00:52
问题 Remember that away message on aim that said how: Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Anyway I'm trying to make a function that would do that to an entire page. There are a few