Skip to main content

Questions tagged [conversion]

This tag indicates that the challenge involves converting from one format to another.

Filter by
Sorted by
Tagged with
67 votes
21 answers
13k views

Translate your English source code into a foreign language [closed]

I have noticed that there are a disproportionate number of computer languages based on English. I propose to fix this by translating existing computer languages into foreign languages! Pick a ...
CJ Dennis's user avatar
  • 4,266
53 votes
22 answers
6k views

Sᴍᴀʟʟ Cᴀᴘꜱ Cᴏɴᴠᴇʀᴛᴇʀ

Portable Spec. Iɴꜱᴘɪʀᴇᴅ ʙʏ @ConorO'Brien's ᴜꜱᴇʀɴᴀᴍᴇ. Aʟꜱᴏ ᴛʜᴀɴᴋꜱ ᴛᴏ @Dᴏᴏʀᴋɴᴏʙ ꜰᴏʀ ꜱʜᴏᴡɪɴɢ ᴍᴇ ᴛʜᴇ ᴇxɪꜱᴛᴇɴᴄᴇ ᴏꜰ ǫ ᴀɴᴅ x. Sᴍᴀʟʟ ...
Maltysen's user avatar
  • 25.7k
43 votes
5 answers
2k views

My god, it's full of spaces!

Some people insist on using spaces for tabulation and indentation. For tabulation, that's indisputably wrong. By definition, tabulators must be used for tabulation. Even for indentation, tabulators ...
Dennis's user avatar
  • 210k
41 votes
27 answers
7k views

Count Like a Babylonian

Challenge Given an ASCII representation of a Babylonian number as input, output the number in Western Arabic numerals. Babylonian Numeral System How did the Babylonians count? Interestingly, they ...
Beta Decay's user avatar
  • 23.4k
38 votes
15 answers
5k views

Temperature Converter

This is a byte sized challenge where you have to convert an input temperature in one of the three units (Celsius, Kelvin and Fahrenheit) to the other two. Input You would be provided with a ...
Optimizer's user avatar
  • 26.5k
38 votes
6 answers
2k views

COBOL Y2K redux

In the 1990s, COBOL computer engineers worked out a way to extend six-digit date fields by converting them to YYYDDD where YYY ...
user avatar
35 votes
15 answers
5k views

How much Mana do I need?

Dungeon Master was one of the first ever real-time role-playing games, originally released in 1987 on the Atari ST. Among other exciting things for the time, it offered a rather sophisticated spell ...
Arnauld's user avatar
  • 193k
31 votes
27 answers
3k views

Golf Text into DNA

Text to DNA golf Challenge Convert input into a DNA output. Algorithm Convert text into ASCII code points (e.g. codegolf -> ...
NoOneIsHere's user avatar
  • 2,201
29 votes
39 answers
4k views

Convert a string of digits from words to an integer

Convert a string containing digits as words into an integer, ignoring leading zeros. Examples "four two" -> 42. ...
Sparkler's user avatar
  • 411
28 votes
40 answers
6k views

12 hour to 24 hour time converter

Amazingly, this simple task doesn't seem to exist already, so... Your task is to write a program that takes as input a 12 hour time, and converts it into "military time", or 24-hour time format. ...
Carcigenicate's user avatar
28 votes
24 answers
2k views

Convert to Bibi-binary

Bibi-binary is a numeric system invented by Boby Lapointe in order to represent numbers in letters which pronunciation seems funny. Your task is to convert decimal numbers into Bibi-binary! ...
Yytsi's user avatar
  • 3,762
28 votes
12 answers
4k views

Densely packed decimal (DPD) to decimal

For nandgame fans: Please try out DPD to decimal in logic gates too! Background Densely packed decimal (DPD) is a way to efficiently store decimal digits in binary. It stores three decimal digits (...
Bubbler's user avatar
  • 76.9k
28 votes
15 answers
4k views

Goodness, it's covered in tabs!

Space indentation users, unite! We must fight against all the lowly tab users! Your mission (should you choose to accept it) is to write a program or function that takes in two arguments: A string: ...
kirbyfan64sos's user avatar
27 votes
55 answers
4k views

Convert C header names to C++ header names

In the C standard library, header names end with a .h suffix: stdio.h In C++, those header names are available in an ...
fredoverflow's user avatar
  • 2,709
26 votes
57 answers
4k views

Converting Strings to Decimals (Gone Wrong)

What? Many programming languages, both practical and esoteric, have functions, methods, etc to convert a given string to a decimal number. This is how the process might work: For each character in ...
SunnyMoon's user avatar
  • 2,699
26 votes
65 answers
7k views

String to Binary

This is a code golf challenge. Just like the title says, write a program to covert a string of ascii characters into binary. For example: "Hello World!" should ...
ericmarkmartin's user avatar
26 votes
20 answers
2k views

Crown hundred crownty crown

I noticed a certain game had a peculiar life counter, which instead of stopping at 999, gained a new digit – the next number was crown hundred or ...
Angs's user avatar
  • 4,987
25 votes
12 answers
3k views

Bake me some moji

Given a string, character list, byte stream, sequence… which is both valid UTF-8 and valid Windows-1252 (most languages will probably want to take a normal UTF-8 string), convert it from (that is, ...
Adám's user avatar
  • 30.4k
24 votes
9 answers
2k views

Bilibili AV/BV Code Conversion

Background Bilibili is a China-based video sharing platform, similar to Nico Nico Douga in Japan, and Youtube around the world. Since the establishment, Bilibili had been using the AV code to ...
Shieru Asakoto's user avatar
23 votes
51 answers
3k views

Running length of the movie in a human readable format

Whenever I search for the running length of a movie in IMDb, it is displayed in minutes. Immediately I would try to convert it into hour(s) and minute(s). It would be better if we could automate this. ...
Vasu Adari's user avatar
23 votes
28 answers
5k views

Generate excel column name from index

This one comes from a real life problem. We solved it, of course, but it keeps feeling like it could have be done better, that it's too lengthy and roundabout solution. However none of my colleagues ...
Vilx-'s user avatar
  • 1,601
23 votes
15 answers
2k views

Convert height to US Men’s Jacket size

In the US, clothing size sometimes has rough designations like M, L, XXL, etc. The US designation of the "men's jacket" category depends on the height of the person. So, in this challenge, ...
anatolyg's user avatar
  • 13.7k
23 votes
2 answers
888 views

Help me procrastinate on my computer repairs!

This challenge is brought to you by real (and tragic) inspiration. Recently, the number row on my keyboard has been a bit sporadic. The keys 1-9 work sometimes--but ...
BrainSteel's user avatar
  • 5,460
22 votes
17 answers
2k views

Neutralize data

To neutralize data, recursively replace all numbers (not digits!) with zeros and all characters (not strings!) with spaces. You must accept any single number, character, or string, or possibly ...
Adám's user avatar
  • 30.4k
20 votes
6 answers
2k views

Make An ASCII Poker Chip Stack Arrangement

Poker has etiquette in how you arrange your chips, often enforced in tournaments - your chips may not be "hidden" from your opponents by being behind others, mostly to not hide some large denomination ...
Jonathan Allan's user avatar
19 votes
21 answers
6k views

Convert an integer to IEEE 754 float

The task is simple: given a 32 bit integer, convert it to its floating point value as defined by the IEEE 754 (32-bit) standard. To put it another way, interpret the integer as the bit-pattern of an ...
zoomlogo's user avatar
  • 1,655
19 votes
22 answers
5k views

Decode a variable-length quantity

A variable-length quantity (also referred to as VLQ or uintvar) is a way to encode up to a 28 bit integer value using only as many bytes as necessary. This was used ...
640KB's user avatar
  • 11.9k
19 votes
19 answers
2k views

Text animation format Code Golf [duplicate]

Working with old files from DOS, I found an ancient text animation format, that specify how much time each frame must be shown in the screen. It's very simple: F1W5F2W3 This example above indicates ...
Chaotic's user avatar
  • 411
19 votes
8 answers
791 views

Convert the Time to a String

Problem One day, you boss walks up to you and tells you he needs to know the time. He still insists after you pointing at the clock directly above your head, and confesses he has a severe case of ...
Dennis van Gils's user avatar
19 votes
5 answers
453 views

Convert an Expression to Panfix Notation

I was browsing esolangs, and chanced upon this language: https://github.com/catseye/Quylthulg. One interesting thing about this language, is that it doesn't use prefix, postfix, or infix, it uses all ...
Maltysen's user avatar
  • 25.7k
18 votes
52 answers
2k views

IPv4 Integer Conversion Function

Write the shortest function to convert an IP address into it's integer representation and output it as an integer. To change an IPv4 address to it's integer representation, the following calculation ...
Kyle Rosendo's user avatar
18 votes
10 answers
5k views

HSL to RGB values

The main purpose of the RGB (Red Green Blue) color model is for the sensing, representation and display of images in electronic systems, such as televisions and computers HSL (Hue Saturation Lightness)...
towc's user avatar
  • 344
17 votes
38 answers
3k views

Convert superscript numbers to normal numbers

Introduction My gnome friends are writing a programming language and have asked for my help. Due to their size, the gnomes can only handle small superscript numbers instead of big numbers. However, ...
Ginger's user avatar
  • 5,650
16 votes
10 answers
2k views

Convert an Excel date code to a "date"

Given a non-negative integer Excel-style date code, return the corresponding "date" in any reasonable form that clearly shows year, month, and "day". Trivial, you may think. Did you notice the "scare ...
Adám's user avatar
  • 30.4k
15 votes
1 answer
888 views

Convert ASCII box drawing into Unicode

I am shamelessly posting a request for something I would actually find useful. The task is to take an arbitrary ascii box drawing like this ...
Alex Zeffertt's user avatar
14 votes
10 answers
2k views

Convert English to a number without built-ins or libraries

This challenge is similar to this other, however I made a restriction (see bold text below) that I think would made it much diffent and (I hope) fun either. The Challenge Write a program or a ...
Bob's user avatar
  • 1,007
14 votes
14 answers
1k views

Short Date into English Long Date

Convert short date format into English long date in as few bytes as possible. Input Input will be in the form of a string with format, yyyy-mm-dd, with zero padding ...
Gareth's user avatar
  • 1,299
14 votes
2 answers
844 views

Densely packed decimal (DPD) to decimal, with logic gates

Inspired by recent popularity of nandgame on TNB, and my own previous challenge. Background Densely packed decimal (DPD) is a way to efficiently store decimal digits in binary. It stores three ...
Bubbler's user avatar
  • 76.9k
13 votes
21 answers
2k views

How to convert HEX2 to RGBA?

The world of art is full of colour, but the world of the network is even fuller than the world of art of diferent colours and it's renderings. That's why we need to know how to convert one type of ...
Obsdarek's user avatar
  • 165
13 votes
1 answer
906 views

EBCDIC code golf (Happy birthday, System/360!)

Pretty soon it's going to be 50 years since IBM unveiled its System/360 family of computers. These were the first to use the EBCDIC character set. To mark the occasion, let's see who can write the ...
r3mainer's user avatar
  • 19.7k
13 votes
1 answer
387 views

Monday Mini-Golf #7: Simplify ingredient measurements

Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday. Sorry it's late; I realized 90% of the way through writing out a different idea that it was a duplicate. My ...
ETHproductions's user avatar
12 votes
7 answers
28k views

Convert between Music clefs

Before you leave, you do not have to understand much musical notation to do this challenge. EXPLANATION In standard sheet music, double clefs go across the page serving as reference points to the ...
qqq's user avatar
  • 1,606
11 votes
7 answers
1k views

Simple DTMF decoding: find the phone key!

This is a simple challenge which hopefully may lead to some creative answers. Quoting Wikipedia: "Dual-tone multi-frequency signaling (DTMF) is an in-band telecommunication signaling system using the ...
Arnauld's user avatar
  • 193k
10 votes
17 answers
1k views

Tesco's Burger Relish Best Before End date number

Given a date between 2010-01-01 and 2099-12-31 as three integers (please state your order if not [year,month,day]), answer with Tesco's corresponding five-digit ...
Adám's user avatar
  • 30.4k
10 votes
14 answers
569 views

Expand Comparison Chains

Unlike most languages, Python evaluates a<b<c as it would be done in mathematics, actually comparing the three numbers, as opposed to comparing the boolean <...
Maltysen's user avatar
  • 25.7k
9 votes
13 answers
2k views

From Rgb to Cmyk

Given 3 bytes or RGB as input, calculate the nearest CMYK values, and output them. create either a function with parameters and return value or a program that operates on stdin/stdout use the color ...
Titus's user avatar
  • 14.7k
9 votes
16 answers
2k views

Convert CMYK values to RGB

Given Color codes in CMYK, convert it to RGB value. Input: string of 4 integers(ranging from 0-100) separated by space 86 86 0 43 28 14 0 6 0 41 73 4 Output: ...
Wasi's user avatar
  • 1,750
9 votes
8 answers
361 views

Convert AWG to Inches

AWG (American Wire Gauge) is a common way of specifying wire sizes. Your task in this challenge is to convert from a given gauge to the diameter of the wire in inches. The size in inches for the ...
Maltysen's user avatar
  • 25.7k
9 votes
1 answer
1k views

Convert Complex Chinese Numbers into Arabic Numbers

Your task is to convert Chinese numerals into Arabic numerals. A problem similar to Convert Chinese numbers, however, more complex. Also, answers given there mostly don't satisfy all the conditions. ...
Rysicin's user avatar
  • 93
8 votes
6 answers
2k views

Fix your trees!

In informatics, we often use trees in lots of different forms and representations. The three major methods of serialising binary trees are prefix, infix and postfix notation. For example, the ...
tomsmeding's user avatar
  • 2,054