# An idea for a new genre of challenges: [code-purchasing]

I have an idea for a new genre of questions, questions, and I thought I would run it through meta before giving it a try.

The basic idea is that you have to try to solve a problem, but certain characters cost certain amounts! Here's a quick example:

I could have this table:

| a-z   | 10 |
| A-Z   | 15 |
| =!    | 15 |
| {}    | 20 |
| ()    | 25 |
| []    | 50 |
| +-*/% | 55 |
| "'    | 60 |
| ;     | 1  |
| other | 80 |


Now lowercase letters cost me 10 points, uppercase cost 15, etc.

I could then limit this challenge to certain languages. Here's a small list off the top of my head:

• C
• C++
• C#
• Java (you get class A{public static void main(String[]a){}} for free)

So, what do you think? Good? Bad? Ideas? Waffles?

• Waffles. Definitely waffles. – Justin Jan 21 '14 at 23:40
• I don't like the idea of restricting entries to specific languages only. In my humble opinion, the best code challenges are language-agnostic. Say I, whose favourite language is not a commonly-used language and who would hate to be excluded from participating. – Chris Jester-Young Jan 21 '14 at 23:47
• @ChrisJester-Young I've always been against language-specific questions too, but this could be abused by using a language in which, say, ;=!{} and letters are the mainly used characters. – Doorknob Jan 21 '14 at 23:48
• You should always ask yourself - if it could be abused maybe it is the definition which is not good. E.g. I'm currently unclear what kind of puzzles are interesting in this new scoring system - i.e. write a challenge where your scoring table makes a reasonable difference to standard code-golf rules. – Howard Jan 22 '14 at 6:31
• +1 for "What makes this interesting?" I see what you are aiming at, but I think that unless you restrict a given challenge of this type to one specific language, it will always have an exploitable bias toward certain languages. For example, in languages where capitalization is reserved for system words/functions, there is a definite bias in scoring upper and lower cases differently. Granted one can argue that code golf itself is implicitly biased toward less-verbose languages, but there's a key distinction in that it is the language, not the questioner's criteria, which imparts that bias. – Jonathan Van Matre Feb 23 '14 at 0:12
• @ChrisJester-Young on the other hand, trivial challenges restricted to languages where they are not trivial are often fun, too. Say, create a 10x10 array in javascript – John Dvorak May 25 '14 at 6:35
• This sucks for No Comment, though that doesn't matter as much; in ncmnt, numbers are represented as unary tildes (~), and multiplication is a comma, etc. – cjfaure May 26 '14 at 9:30

The main idea is good, but it would only work in a language-specific way, as someone will definitely find a language, that uses differnet characters to represent the concepts.

| calling a function              | 10 + 2*parameters |
| pushing a value onto the stack  | 20                |
| assigning a value to a variable | 15                |
| using a code block              | 5                 |
etc.


Of coure there might be debates on what can be considered a "function call" or a "code block" in like Befunge or GolfScript, but these might be ironed out in the tag wiki.

The result cost might be based on the character count + the cost of the language features

• Definitely worth keeping a raw character count in the play. I like the challenge of having to track which one-character variable is which. (Yeah, I know I could just as well refactor after debugging, but that's no fun) – John Dvorak May 25 '14 at 6:38

It's an objective winning criteria.

I don't know that I'd find it particularly compelling, but I don't see any bar to using it on the site.

I am wondering about the name, though. ?

• I'm not asking whether it would be allowed; I'm just asking for input from the community. Yeah, I'm terrible at coming up with names :-P – Doorknob Jan 22 '14 at 2:31
• The correct name surely involves the word weighted. – Peter Taylor Jan 22 '14 at 11:05
• – user10766 Feb 20 '14 at 23:30
• Or perhaps "green fees"? – Jonathan Van Matre Feb 23 '14 at 0:07