text:
One Letter Swap
The largest forum on the web, called postcount++ decided to make a new forum game. In this game, the goal is to post the word, but the word has to have one letter added, removed, or changed. Your boss wanted you to write a program which gets the word, and the UNIX dictionary, as you work for company who has more intelligent forum with more intelligent forum games, and wants to destroy the competition (hey, it's your boss, don't discuss with him, you get lots of cash from your job anyway).
Your program will get two arguments, the word, and the dictionary. Because the user managing the program (yes, an user, your company doesn't have resources to run bots) is not perfect, you should normalize the case in both. The words in dictionary may have ASCII letters (both upper-case and lower-case, but it should be ignored during comparison), dashes, apostrophes, and non-consecutive spaces in middle. They won't be longer than 78 characters. You have to output list of words that would be accepted in the game, to break the fun of people who think of words manually.
This is an example of your expected program, checking for similar words to golf.
> ./similar golf /usr/share/dict/words
Goff
Wolf
gold
golfs
goof
gulf
wolf

The /usr/share/dict/words is a list of words, with line break after each. You can easily read that with fgets(), for example.
The company you work in doesn't have much punch cards (yes, it's 2014, and they still use punch cards), so don't waste them. Write as short program as possible. Oh, and you were asked to not use built-in or external implementations of Levenshtein distance or any similar algorithm. Something about Not Invented Here or backdoors that apparently the vendor inserted into the language (you don't have proof of those, but don't discuss with your boss). So if you want distance, you will have to implement it yourself.
You are free to use any language. Even with punch cards, the company has the access to most modern of programming languages, such as Cobol Ruby or Haskell or whatever you want. They even have GolfScript, if you think it's good for string manipulation (I don't know, perhaps...).
The winner gets 15 reputation points from me, and probably lots of other points from the community. The other good answers will get 10 points, and points from community as well. You heard that points are worthless, but most likely that they will replace dolars in 2050. That wasn't confirmed however, but it's good idea to get points anyway.

We should not "use built-in or external implementations of Levenshtein distance or any similar algorithm"? There goes the 30 character Mathematica solution.

@MichaelStern and a similarly short python one using the fuzzy matching of this regex library

Almost the same as http://codegolf.stackexchange.com/questions/6939/find-the-number-of-strings-from-the-list-that-have-a-levenshtein-distance-of-3-o.

"such as Ruby or Haskell" - ok, I've got it, you want me to participate.

Please provide a better example, so that all types of changes would appear or people will keep submitting wrong algorithms.

GolfScript, 59 chars
{32|}%"*"%.|(:w;{:x,),{:^[x>.1>]{.[^w=]\+}%{^x<\+w=},},},n*

Sure, GolfScript is great for string manipulation!
What GolfScript is not so good at is handling file I/O or command-line arguments.  Thus, this program expects to receive all its input via stdin: the first non-blank line is taken to be the target word, while the remaining lines should contain the dictionary.  On a Unixish system, you can run this code e.g. with:
(echo golf; cat /usr/share/dict/words) | ruby golfscript.rb similar.gs

On my Ubuntu Linux box, the output of the above command is:
goff
wolf
gold
golfs
goof
gulf

Note that all the words are converted to lowercase, and any duplicates are eliminated; thus, unlike your sample output, mine does not list Wolf and wolf separately.  Based on your challenge description, I assume this is acceptable.
Also, the code is really slow, since it uses a fairly brute force approach, and doesn't use even obvious optimizations like checking that the length of the candidate word matches that of the target word ± 1.  Still, it does manage to go through the full, unfiltered /usr/share/dict/words list in... um... I'll let you know when it finishes, OK?
Edit: OK, it took about 25 minutes, but it did finish.

+1 for an accurate representation of how good GolfScript is for string manipulation (and doing string manipulation in GolfScript)

Bash + coreutils, 99 bytes
Either I totally misunderstood the question (@lambruscoAcido's answer gives very different results), or this is a fairly straightforward regexp application:
for((i=0;i<${#1};i++)){
a=${1:0:i}
b=${1:i+1}
egrep -i "^($a$b|$a.$b|$a.${1:i}|$1.)$" $2
}|sort -u

Output:

$ ./similar.sh golf /usr/share/dict/words
Goff
gold
golf
golfs
goof
gulf
wolf
Wolf
$

Can you please explain what ${a:b:c}  do?

@n.1 it takes the characters at positions b to c in the variable a

@professorfish Close - its the substring of length c starting at position b (zero-based) from variable a.  Substring expansion is one of the bash parameter expansions

@DigitalTrauma oh I forgot even though I keep using it in my Bash golfs

Python 3, 291 characters
Very straightforward, and thus not very clever. But with a big yummy generator tangle and optimized slowness. Because you don't want to leave your allocated computation time unused, do you?
from itertools import*
from sys import*
a=argv[1].lower()
r,l=range,len
n=l(a)
print('\n'.join((b for b in(s.strip()for s in open(argv[2]).readlines())if l(b)>n-2and b.lower()in(''.join(compress(a,(i!=j for j in r(n))))for i in r(n))or n==l(b)and sum(1for i in r(n)if a[i]!=b.lower()[i])<2)))

Can use l=len and r=range to reduce those functions further.

Python, 174 chars:
Quick and to the point.
import re;from sys import*;w=argv[1]
print"\n".join(set(sum([re.findall(r"\b%s%s?[^'\n]?%s\b"%(w[:i],w[i],w[i+1:]),open(argv[2]).read(),re.I)for i in range(len(w))],[]))-{w})

Example:
python similar.py golf /usr/share/dict/words

Output:
goof
gola
gulf
gold
gol
gowf
goli
Golo
Gulf
goaf
Wolf
Goll
Rolf
wolf
goff
Gold

I suppose the OS X words file just has more entries.

List shouldn't include word itself and also it doesn't ignore apostrophes: with UNIX dictionary it also has golf'.

What do you mean by ignoring apostrophes? After re-reading the prompt, I still don't see what you are getting at.

If I run your code on dictionary with golf' in it, it will be printed.

Ah, I had misread the prompt, but it's fixed now.

Scala - 403 130
[Updated]: completely updated because former solution also allowed for permuted letters. Does not use regex or any builtin tools.
def f(x:String,d:List[String])={for{y<-d;c=(x zip y filter(t=>t._1!=t._2)length);n=y.length-x.length;if c<2&n==0|c==0&n==1}yield y

Ungolfed:
def f(x:String, d:List[String]) = {
  for {
    y <- d
    c = (x zip y filter (t=>t._1!=t._2) length)  // #letter changes.
    n = y.length-x.length                        // Difference in word length.
    if c<2 & n==0 | c==0 & n==1
  } yield y
}

Usage:
f("golf", io.Source.fromFile("/usr/share/dict/words").getLines.toList)

@DigitalTrauma Can you give me an example for that issue?

I got it: I also considered all the permutations of the letters. Sigh - so the reality is easier. Thanks...

atechny doesn't change one letter. This solution does something unrelated to the question.

+1. looks like it fits the spec better now ;-)

A complete program would be nice, not just function.

Rebol - 213
set[i d]split system/script/args" "r:[skip i | i skip]repeat n length? i[append r compose[|(poke s: split i 1 n 'skip s)|(head remove at copy i n)]]foreach w read/lines to-file d[if all[w != i parse w r][print w]]

Ungolfed (with some some comments):
set [i d] split system/script/args " "

; build parse rule
r: [skip i | i skip]       ; RULE - one letter added (prefix and postfix)

; sub-rule for each letter in word
repeat n length? i [
    append r compose [
        | (poke s: split i 1 n 'skip s)     ; RULE - letter changed
        | (head remove at copy i n)         ; RULE - letter removed
    ]
]

foreach w read/lines to-file d [
    if all [w != i parse w r] [print w]
]

Usage example (tested in Rebol 3 on OS X Lion):
$ rebol similar.reb golf /usr/share/dict/words
goaf
goff
gol
gola
Gold
gold
goli
Goll
Golo
goof
gowf
Gulf
gulf
Rolf
Wolf
wolf

Below is the parse rule created to match similar words to golf:
[
    skip "golf"
  | "golf" skip
  | skip "o" "l" "f"
  | "olf"
  | "g" skip "l" "f"
  | "glf"
  | "g" "o" skip "f"
  | "gof"
  | "g" "o" "l" skip
  | "gol"
]

Haskell - 219
import System.Environment
import Data.Char
u@(x:a)%w@(y:b)|x==y=a%b|1>0=1+minimum[a%w,u%b,a%b]
x%y=max(length x)$length y
main=do[w,d]<-getArgs;readFile d>>=mapM putStrLn.filter((==1).(%map toLower w).map toLower).words

Python (103):
f=lambda x:[a for a in open('/usr/share/dict/words')if len(x)==len(a)&sum(b!=c for b,c in zip(a,x))==1]

Quite efficient, I think. Also, I like how well this golfed in Python.

You don't account for removal or adding a character.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Moving CSS rules from a CSS file to inline attributes
The goal is to take CSS rules from a regular CSS file and apply them to their respective targets in an HTML file, but by placing the rules in the style="" attribute (using the

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Finish lazy parentheses
The parentheses on my keyboard are all worn out, and I want to avoid using them as much as possible. Your challenge is to balance a line containing parentheses by adding them in before and after each line.
This is similar to TI-Basic's automatic parentheses and string closure (i.e. Output(1, 1, "Hello, World!). It also saves precious bytes from a program!
Example input:
This line has no parentheses
alert(Math.max(1, 2
1+1)*2).toString()
function() { alert('Hello, World!'); })(

Example (possible) output:
This line has no parentheses
alert(Math.max(1, 2))
((1+1)*2).toString()
(function() { alert('Hello, World!'); })()

Specification:

For each line of input,

Add as many open parentheses to the beginning and close parentheses to the end of the line as needed to balance the parentheses in the line

The definition of "balance" is:

Same amount of ( and ) in the line
For every substring starting from the beginning of the string, this substring must not have more closing parentheses than opening parentheses

For example, (foo))(bar is not balanced because (foo)) has more closing parentheses than opening parentheses

You may add extra unnecessary parentheses if you want to, if it makes your code shorter
You do not need to worry about string literals or anything like that, assume that all parentheses need balancing

Output each line with parentheses balanced

This is code-golf, so the shortest code in bytes will win!

Are you just concerned with () parens, or do other brackets {}, [], <>, etc need to be considered as well?

@DigitalTrauma Nope, only ( and ).

Do you have any test cases?

@Peter Yeah, they're right there in the post...

GolfScript, 23 bytes
n/{"()"1/{.2$\-,*}%*n}/

The loophole I'm exploiting is the ruling that:

You may add extra unnecessary parentheses if you want to, if it makes your code shorter

Basically, for each line, this code counts the number of characters on the line that are not opening parentheses, and prepends that many extra opening parentheses to the line, and then does the same for closing parentheses.  This is incredibly inefficient, but does ensure that all the parentheses on the output line are balanced.
For example, given the input:
This line has no parentheses
alert(Math.max(1, 2
1+1)*2).toString()
function() { alert('Hello, World!'); })(

this program will output:
((((((((((((((((((((((((((((This line has no parentheses))))))))))))))))))))))))))))
(((((((((((((((((alert(Math.max(1, 2)))))))))))))))))))
(((((((((((((((((1+1)*2).toString())))))))))))))))
(((((((((((((((((((((((((((((((((((((function() { alert('Hello, World!'); })()))))))))))))))))))))))))))))))))))))

Ps. You can also test this code online.

This reminds me of when I used to program in Lisp... A few bits of code lost in a sea of parenthesis.

Perl, 32 = 31 + 1 or 73 = 72 + 1 (minimized parentheses)
32 = 31 + 1: with extra unnecessary parentheses
Edits:

Fix, parentheses now counted with y///.
Unnecessary variable $a removed.

$_="("x y/)//.s|$|")"x y/(//|er

It is used with the run-time switch -p (+1 byte).
Test file input.txt:
This line has no parentheses
alert(Math.max(1, 2
1+1)*2).toString()
function() { alert('Hello, World!'); })(
(foo))(bar
)))(((
((
))

Command line:
perl -p script.pl <input.txt

or
perl -pe '$_="("x y/)//.s|$|")"x y/(//|er' <input.txt

Result:
This line has no parentheses
alert(Math.max(1, 2))
(((1+1)*2).toString())
(((function() { alert('Hello, World!'); })()))
(((foo))(bar))
((()))((()))
(())
(())

Ungolfed:
The algorithm is simple, just add the counterpart for each found parentheses.
$_ =                     # $_ is provided as input by switch `-p` and
                         # it is printed afterwards as output.
                         # y/X// is used to count the character 'X' in $_
    '(' x y/)//          # add opening parentheses for each closing parentheses
    . s|$|')' x y/(//|er # go right before the end of line and insert
                         # closing parentheses for each opening parentheses
                         # in the original string

73 = 72 + 1: adding minimum number of parentheses
This script only adds the minimum number of parentheses to get a balanced output.
$a=y/()//cdr;1while$a=~s/\(\)//g;$_=$a=~y/)(/(/dr.$_;s|$|$a=~y/()/)/dr|e

It is used with the run-time switch -p (+1 byte).
perl -pe "$a=y/()//cdr;1while$a=~s/\(\)//g;$_=$a=~y/)(/(/dr.$_;s|$|$a=~y/()/)/dr|e" <input.txt

Result:
This line has no parentheses
alert(Math.max(1, 2))
((1+1)*2).toString()
(function() { alert('Hello, World!'); })()
((foo))(bar)
((()))((()))
(())
(())

Ungolfed:
$a = y/()//cdr;            # filter parentheses and store in $a
1 while $a =~ s/\(\)//g;   # remove matching parentheses
$_ = $a =~ y/)(/(/dr . $_; # add missing opening parentheses at start of string
s|$|$a=~y/()/)/dr|e        # insert missing closing parentheses at end of string

81 = 80 + 1: adding minimum number of parentheses
This is an older method to add the minimum number of parentheses for a balanced output.
my($l,$r);s/[()]/($&eq")"&&($r&&$r--||++$l))||$r++/ger;$_="("x$l.$_;s/$/")"x$r/e

It uses Perl 5.14 (because of the non-destructive substitution modifier) and the run-time switch -p (+1 byte).
perl -p script.pl <input.txt

Result:
This line has no parentheses
alert(Math.max(1, 2))
((1+1)*2).toString()
(function() { alert('Hello, World!'); })()
((foo))(bar)
((()))((()))
(())
(())

Ungolfed:
# The while loop is added by option "-p".
LINE:
while (<>) {

    # $_ contains the current line
    my ($l, $r); # initializes $l and $r (to undef/kind of indirect 0)
    # Modifiers for the following substitution of $_:
    # /g: process all parentheses
    # /e: evaluate code
    # /r: does not change the original input string $_ (Perl 5.14)
    s/[()]/
        # $& contains the matched parentheses
        # $r is a balance level counter; at the end $r contains
        #    the number of needed closing parentheses
        # $l is the number of needed opening parentheses;
        #    if $r would go negative, then an opening parentheses
        #    is missing and $l is increases and $r remains zero.
        (
            $& eq ")" &&   # case ")"
            ($r && $r--    # close a parentheses group and update balance counter
                || ++$l)   # or update $l if an opening parentheses is needed
        )
        || $r++            # case "(": increase balance counter
    /ger;
    $_ = "(" x $l . $_;    # add opening parentheses at the begin of line
    s/$/")" x $r/e         # add closing parentheses before the line end

# the remainder is added by run-time switch "-p"
} continue {
    print or die "-p destination: $!\n";
}

Wow, that almost looks like golfscript ;-)

@HeikoOberdiek What perl are you using for the first version? It doesn't seem to work on 18.1 due to '('x/\)/g always equaling '('...

@Mouq: Thanks, fixed now using y/// instead of m//g for counting the parentheses.

Python 2.7 3: 62 60 58 bytes
while 1:s=input();c=s.count;print('('*c(')')+s+')'*c('('))

Not super golfed, but you know. I might be able to squeeze some more bytes out if I really tried.
For each line, outputs (*the number of ) in the line, then the line, then )*the number of ( in the line. If I understand the rules correctly, this will always provide valid output.
Exits by throwing an exception, as a result of the way I did input. (Input is always a hard part of these problems.) If this isn't acceptable, it'll cost me a few bytes to fix, though I'm not yet sure how many.
Example output:
This line has no parentheses
alert(Math.max(1, 2))
(((1+1)*2).toString())
(((function() { alert('Hello, World!'); })()))

This does not appear to take multiline input, i.e. prints are interspersed with lines of input. But nice algorithm idea, I didn't think of that ;)

python2 balanced_parenthesis.py < input.txt 2>/dev/null gets the output I wrote but if you want multiline input while doing it interactively it'll cost me a few bytes. Give me a second, I'll figure something out...

Ah, okay, never mind then. That will work!

save 2 chars: while 1:s=raw_input();c=s.count;print'('*c(')')+s+')'*c('(')

@qui Oh, wow. I came so close to figuring that out, but I didn't realize you could do c=s.count. I thought you had to do c=s, s.c(). Thanks!

Actually, why not do python 3 (save another 2 bytes)?: while 1:s=input();c=s.count;print('('*c(')')+s+')'*c('('))

@qui I should really make a habit of going over my solutions and making sure they wouldn't be any shorter in python 3. :P Thanks again!

Pure Bash, 72 bytes
Uses the same algorithm as @undergroundmonorail's answer:
while read a;do
o=${a//[!(]}
c=${a//[!)]}
echo ${c//)/(}$a${o//(/)}
done

Output:
$ ./lazyparens.sh < input.txt
This line has no parentheses
alert(Math.max(1, 2))
(((1+1)*2).toString())
(((function() { alert('Hello, World!'); })()))
$


text:
Draw a regular polygon
The goal of this code golf is to draw a regular polygon (one with equal side lengths) given the number of sides and radius (distance from center to vertex).

The number of sides and the radius can be entered via a file, STDIN, or just a plain old variable. Use whatever is shorter in your language.
-25% of total characters/bytes if the image is actually drawn instead of ASCII art.

What is the radius of a polygon? The radius of its incircle? Its outcircle?

There. I fixed it. Sorry about that :P.

@PeterTaylor The radius of a regular polygon is the distance to any vertex (radius outcircle or circumradius). The incircle's radius(or distance to sides) is called the apothem. This shouldn't be "unclear what you're asking", since it has an easily found definition (#1 result for "radius of a polygon" on google).

@Geobits I agree, but I still edited it anyway.

@PeterTaylor I'll tag it as both then :I

@Taconut It would become a better challenge if you take length of one side as second input instead of radius.

@MukulKumar radius=length/(2*sin(180/sides)) ? (Or pi rather than 180 if using radians)

@Geobits oops! just forgot that kind of relationship!

What should the polygon look like? Why should the side length defined by the relationship above ^^ always be an integer? Please clarify,

I feel like ASCII art might deserve more of a discount on bytes more than actually drawing something in this question.

LOGO 37 - 25% = 27.75 (with variables)
REPEAT:S[FD:R*2*sin(180/:S)RT 360/:S]

LOGO 49 - 25% = 36.75 (as a function)
TO P:R:S REPEAT:S[FD:R*2*sin(180/:S)RT 360/:S]END

Triangle
Called with variables
Make "R 100
Make "S 3
REPEAT:S[FD:R*2*sin(180/:S)RT 360/:S]

Used as a function P 100 3

Square
Called with variables
Make "R 100
Make "S 4
REPEAT:S[FD:R*2*sin(180/:S)RT 360/:S]

Used as a function P 100 4

Pentagon
Called with variables
Make "R 100
Make "S 5
REPEAT:S[FD:R*2*sin(180/:S)RT 360/:S]

Used as a function P 100 5

Decagon
Called with variables
Make "R 100
Make "S 10
REPEAT:S[FD:R*2*sin(180/:S)RT 360/:S]

Used as a function P 100 10

Circle
Called with variables
Make "R 100
Make "S 360
REPEAT:S[FD:R*2*sin(180/:S)RT 360/:S]

Used as a function P 100 360

Can you post a screen shot?

To my eye the polygons have the same side, not radius.

@RossMillikan: The Images were not to scale. I just updated the images

Mathematica, 40 - 25% = 30
ListPolarPlot[r&~Array~n]/.PointPolygon

Great. That beat what I tried with Graphics.

No fair!  Too easy!

Nicely done, this would never have occurred to me.

Is Graphics@RegularPolygon not allowed?

@GregMartin It's allowed, but it's much harder to specify radius with it.

@ASCII-only Graphics@RegularPolygon[{r,0},n]

Java 8 : 533 322 - 25% = 241.5
Well, it's Java :/ Just draws lines, point to point. Should work for any arbitrarily sized polygon. Cut it down quite a bit from original size. Huge credit to Vulcan (in comments) for the golf lesson.
import java.awt.*;class D{public static void main(String[]v){new Frame(){public void paint(Graphics g){int i=0,r=Short.valueOf(v[0]),s=Short.valueOf(v[1]),o=r+30,x[]=new int[s],y[]=x.clone();for(setSize(o*2,o*2);i<s;x[i]=(int)(Math.cos(6.28*i/s)*r+o),y[i]=(int)(Math.sin(6.28*i++/s)*r+o));g.drawPolygon(x,y,s);}}.show();}}

Line Breaks:
import java.awt.*;
class D{
    public static void main(String[]v){
        new Frame(){
            public void paint(Graphics g){
                int i=0,r=Short.valueOf(v[0]),s=Short.valueOf(v[1]),o=r+30,x[]=new int[s],y[]=x.clone();
                for(setSize(o*2,o*2);i<s;x[i]=(int)(Math.cos(6.28*i/s)*r+o),y[i]=(int)(Math.sin(6.28*i++/s)*r+o));
                g.drawPolygon(x,y,s);
            }
        }.show();
    }
}

Input is arguments [radius] [sides]:
java D 300 7

Output:

Shave off a byte by replacing class by enum

@RobAu The only way I can get that to compile is by adding a ; and losing the saved character.

Oh yes, you are right.. An enum needs at least an enum definition

Eliminate 12 bytes by importing java.awt.image.* instead of java.awt.image.BufferedImage

@Vulcan Not sure how I missed that, thanks!

I've reduced it to 500 bytes using a few tricks. 1) Use Short.valueOf instead of Integer.valueOf to save four bytes, as input should never exceed the range of shorts. 2) y[]=x.clone() saves one byte over y[]=new int[s]. 3) Use the deprecated f.show(); instead of f.setVisible(1>0); to save an addition nine bytes. 4) Use 6.28 instead of Math.PI*2, as the estimation is accurate enough for this purpose, saving three bytes. 5) Declare Graphics g instead of Graphics2D g when creating the graphics instance to save two bytes.

@Vulcan I got it down another 120 (mainly by trashing the BufferedImage and Graphics altogether and just throwing everything in paint()). It did change the color of the image, though it still looks good IMO. Thanks for making me take another look at this :)

@Geobits Great improvements. Working off of your reduced version, I've cut it down further to 349 bytes by eliminating the Frame as a local variable, removing the d integer, and using/abusing the for-loop to save a few characters, mainly semicolons.  Here's a version with whitespace as well.

@Vulcan Nice! I didn't think about pulling setSize() in, so I couldn't figure out a way to get rid of the Frame.

Reduced to 325 bytes by using drawPolygon instead of drawLine.  Whitespace version.

@Vulcan Never knew about drawPolygon, nice. Might as well shave off 3 more by pulling the loop in. I'm running out of stuff to do here...

I can't think of anything else to further reduce the bytes either; great work.

@Vulcan Actually, r=Short.valueOf(v[0]),s=Short.valueOf(v[1]) can be golfed to r=new Short(v[0]),s=new Short(v[1]) (-8 bytes) - and yes, I know this answer is from 2+ years ago. ;) And I agree, great work with this answer!

@KevinCruijssen Hah nice one!

Since you specified it as Java 8, you can change class D{public static void main( to interface D{static void main( to save 3 more bytes.

TeX/TikZ (60 – 80.25)
File polygon.tex:
\input tikz \tikz\draw(0:\r)\foreach\!in{1,...,\n}{--(\!*360/\n:\r)}--cycle;\bye

(80 bytes)
The radius and number of sides are provided as variables/macros \r and \n.
Any TeX unit can be given for the radius. Without unit, the default unit cm is used. Examples:
\def\r{1}\def\n{5}    % pentagon with radius 1cm
\def\r{10mm}\def\n{8} % octagon with radius 10mm

(16 bytes without values)
If the page number should be suppressed, then it can be done by
\footline{}

(11 bytes)
Examples for generating PDF files:
pdftex "\def\r{1}\def\n{3}\input polygon"

pdftex "\def\r{1}\def\n{5}\input polygon"

pdftex "\def\r{1}\def\n{8}\input polygon"

pdftex "\def\r{1}\def\n{12}\input polygon"

Score:
It is not clear to, what needs counting. The range for the score would be:

The base code is 80 bytes minus 25% = 60
Or all inclusive (input variable definitions, no page number): (80 + 16 + 11) minus 25% = 80.25
If the connection between the first and last point do not need to be smooth, then --cycle could be removed, saving 7 bytes.

Geogebra, 42 – 25% = 31.5 bytes
If you count in characters instead of bytes, this would be 41 – 25% = 30.75 characters.
(That is, if you consider Geogebra a language...)
Assumes the radius is stored in the variable r and the number of sides stored in the variable s.
Polygon[(0,0),(sqrt(2-2cos(2π/s))r,0),s]

This uses the cosine theorem c2 = a2 + b2 – 2 a b cos C to calculate the side length from the given radius.
Sample output for s=7, r=5

C, 359 Chars
My first attempt at golfing. At least it beats the Java solution ;-)
int r,n,l,g,i,j,x,y;char* b;float a,c,u,z,p,q,s,t;main(int j,char**v){r=atoi(v[1]);b=malloc(g=(l=r*2+1)*r*2+1);memset(b,32,g);for(j=g-2;j>0;j-=l){b[j]='\n';}b[g-1]=0;a=2*3.14/(n=atoi(v[2]));for(;i<=n;i++,p=s,q=t){c=i*a;s=sin(c)*r+r;t=cos(c)*r+r;if(i>0){u=(s-p)/r,z=(t-q)/r;for(j=0;j<r;j++){x=p+u*j;y=q+z*j;if(x>=0&&y>=0&&y<r*2&&x<l-1)b[y*l+x]='#';}}}puts(b);}

ungolfed:
int r,n,l,g,i,j,x,y;
char* b;
float a,c,u,z,p,q,s,t;
main(int j,char**v){
    r=atoi(v[1]);
    b=malloc(g=(l=r*2+1)*r*2+1);
    memset(b,32,g);
    for(j=g-2;j>0;j-=l){b[j]='\n';}
    b[g-1]=0;
    a=2*3.14/(n=atoi(v[2]));
    for(;i<=n;i++,p=s,q=t){
        c=i*a;s=sin(c)*r+r;t=cos(c)*r+r;
        if(i>0){
            u=(s-p)/r,z=(t-q)/r;
            for(j=0;j<r;j++){
                x=p+u*j;y=q+z*j;
                if(x>=0&&y>=0&&y<r*2&&x<l-1)b[y*l+x]='#';
            }
        }
    }
    puts(b);
}

And it's the only program that outputs the polygon in ASCII instead of drawing it. Because of this and some floating point rounding issues, the output doesn't look particularly pretty (ASCII Chars are not as high as wide).
                 ######
               ###    ###
            ####        ####
          ###              ###
        ###                  ####
     ###                        ###
     #                            #
     #                            ##
    #                              #
    #                              #
   ##                              ##
   #                                #
  ##                                ##
  #                                  #
  #                                  #
 ##                                  ##
 #                                    #
##                                    ##
#                                      #
#                                      #
#                                      #
#                                      #
##                                    ##
 #                                    #
 ##                                  ##
  #                                  #
  #                                  #
  ##                                ##
   #                                #
   ##                              ##
    #                              #
    #                              #
     #                            ##
     #                            #
     ###                        ###
        ###                  ####
          ###              ###
            ###         ####
               ###    ###
                 ######

The first int can be removed since they are assumed to be int by the compiler. Also, the last for loop can be changed to for(j=0;j<r;){x=p+u*j;y=q+z*j++;//...

The if(i<0) could be changed to if(i). Which is still only needed in one iteration, but couldn't find an efficient way to take it out :(

C: 229 180
#include<stdio.h>
#include<math.h>
main(){float n=5,r=10,s=tan(1.57*(1.-(n-2.)/n))*r*2.,i=0,j,x,c,t;int u,v;for(;i<n;i++)for(j=0;j<s;j++)x=i*6.28/n,c=cos(x),t=sin(x),x=j-s/2.,u=c*r+t*x+r*2.,v=-t*r+c*x+r*2,printf("\e[%d;%dH*",v,u);}

(r is radius of incircle)
Please run in ANSI terminal

Edit:
take ace's suggestionuse old variables (or #define) as inputuse circumcircle radius now
u;main(v){float p=3.14,r=R*cos(p/n),s=tan(p/n)*r*2,i=0,j,x,c,t;for(;i++<n;)for(j=0;j<s;)x=i*p/n*2,c=cos(x),t=sin(x),x=j++-s/2,u=c*r+t*x+r*2,v=c*x-t*r+r*2,printf("\e[%d;%dH*",v,u);}

compile:
gcc -opoly poly.c -Dn=sides -DR=radius -lm

When you use gcc you can actually omit the #includes. Also, you can declare v as global outside main, and declare u as a parameter of main, then you don't need int (i.e. v;main(u){//...). Finally, you can change the last for loop into for(j=0;j<s;)/*...*/x=j++-s/2.,//...

Mathematica, 54 * 75% = 40.5
Graphics@Polygon@Table[r{Cos@t,Sin@t},{t,0,2Pi,2Pi/n}]

I don't even think there's a point for an ungolfed version. It would only contain more whitespace.
Expects the radius in variable r and number of sides in variable n. The radius is a bit meaningless without displaying axes, because Mathematica scales all images to fit.
Example usage:

Graphics@Polygon@Array[r{Sin@#,Cos@#}&,n+1,{0,2π}]

@chyaong ah, I tend to forget about Array .

HTML/JavaScript : 215 - 25% = 161.25, 212 - 25% = 159
<canvas><script>R=100;i=S=10;c=document.currentScript.parentNode;c.width=c.height=R*2;M=Math;with(c.getContext("2d")){moveTo(R*2,R);for(;i-->0;){a=M.PI*2*(i/S);lineTo(R+M.cos(a)*R,R+M.sin(a)*R)}stroke()}</script>

Ungolfed version :
<canvas><script>
    var RADIUS = 100;
    var SIDES_COUNT = 10;
    var canvas = document.currentScript.parentNode;
    canvas.width = canvas.height = RADIUS * 2;
    var context = canvas.getContext("2d");
    context.moveTo(RADIUS * 2, RADIUS);
    for(i = 1 ; i <= SIDES_COUNT ; i++) {
        var angle = Math.PI * 2 * (i / SIDES_COUNT);
        context.lineTo(
            RADIUS + Math.cos(angle) * RADIUS,
            RADIUS + Math.sin(angle) * RADIUS
        );
    }
    context.stroke();
</script>

Save 4 chars by i=S=5; and for(;i-->0;).

@Matt Thank you ! I didn't know this syntax, and can't find any information about it. How is it called ?

@sebcap26 Do you mean the i-->0 part? It's the same as i-- > 0. Some people also call it the arrow operator or the goes to operator ;)

No worries :) As @sebcap26 said, it's just decrementing every time the for loop evaluates the condition.

I think you can save chars removing c=document.currentScript.parentNode; and replacing <canvas> by <canvas id="c">

bc + ImageMagick + xview + bash, 104.25 (139 bytes - 25%)
This challenge would be incomplete without an ImageMagick answer...
convert -size $[$2*2]x$[$2*2] xc: -draw "polygon `bc -l<<Q
for(;i++<$1;){t=6.28*i/$1;print s(t)*$2+$2,",";c(t)*$2+$2}
Q`" png:-|xview stdin

For example, ./polygon.sh 8 100 produces this image:

Postscript 156 - 25% = 117
translate exch 1 exch dup dup scale div currentlinewidth mul setlinewidth
1 0 moveto dup{360 1 index div rotate 1 0 lineto}repeat closepath stroke showpage

Pass the radius, number of sides, and center point on the command line
gs -c "100 9 300 200" -- polyg.ps

or prepend to the source
echo 100 9 300 200 | cat - polyg.ps | gs -

Translate to the center, scale up to the radius, move to (1,0); then repeat n times:
rotate by 360/n, draw line to (1,0); draw final line, stroke and emit the page.

Sage, 44 - 25% = 33
Assumes the number of sides is stored in the s variable and the radius is stored in the r variable.
polytopes.regular_polygon(s).show(figsize=r)

Sample output:
s=5, r=3

s=5, r=6

s=12, r=5

The scaling of the axes is misleading.  Is that fixable? (e.g first point at (0,3) when radius=3, instead of (0,1))

@DigitalTrauma My program basically generates the "standard" regular polygon, then enlarges the image by a scale factor. As far as I know the regular_polygon function always generates polygons with the first vertex at (0,1). A fix would be to not show the axes with an additional 7 bytes (,axes=0 after figsize=r)

JavaScript 584 (867 ungolfed)
This code uses N Complex Roots of unity and translates the angles to X,Y points. Then the origin is moved to centre of the canvas.
Golfed
function createPolygon(c,r,n){
c.width=3*r;
c.height=3*r;
var t=c.getContext("2d");
var m=c.width/2;
t.beginPath();
t.lineWidth="5";
t.strokeStyle="green";
var q=C(r, n);
var p=pts[0];
var a=p.X+m;
var b=p.Y+m;
t.moveTo(a,b);
for(var i=1;i<q.length;i++)
{
p=q[i];
t.lineTo(p.X+m,p.Y+m);
t.stroke();
}
t.lineTo(a,b);
t.stroke();
}
function P(x,y){
this.X=x;
this.Y=y;
}
function C(r,n){
var p=Math.PI;
var x,y,i;
var z=[];
var k=n;
var a;
for(i=0;i<k;i++)
{
a = 2*i*p/n;
x = r*Math.cos(a);
y = r*Math.sin(a);
z.push(new P(x,y));
}
return z;
}

Sample output:

Ungolfed
function createPolygon(c,r,n) {
c.width = 3*r;
c.height = 3*r;
var ctx=c.getContext("2d");
var mid = c.width/2;
ctx.beginPath();
ctx.lineWidth="5";
ctx.strokeStyle="green";
var pts = ComplexRootsN(r, n);
if(null===pts || pts.length===0)
{
alert("no roots!");
return;
}
var p=pts[0];
var x0 = p.X + mid;
var y0 = p.Y + mid;
ctx.moveTo(x0,y0);
for(var i=1;i<pts.length;i++)
{
p=pts[i];
console.log(p.X +"," + p.Y);
ctx.lineTo(p.X + mid, p.Y + mid);
ctx.stroke();
}
ctx.lineTo(x0,y0);
ctx.stroke();
}

function Point(x,y){
this.X=x;
this.Y=y;
}

function ComplexRootsN(r, n){
var pi = Math.PI;
var x,y,i;
var arr = [];
var k=n;
var theta;
for(i=0;i<k;i++)
{
theta = 2*i*pi/n;
console.log('theta: ' + theta);
x = r*Math.cos(theta);
y = r*Math.sin(theta);
console.log(x+","+y);
arr.push(new Point(x,y));
}
return arr;
}

This code requires HTML5 canvas element, c is canvas object, r is radius and n is # of sides.

PHP 140 - 25% = 105
<?
for(;$i++<$p;$a[]=$r-cos($x)*$r)$a[]=$r-sin($x+=2*M_PI/$p)*$r;
imagepolygon($m=imagecreatetruecolor($r*=2,$r),$a,$p,0xFFFFFF);
imagepng($m);

Assumes two predefined variables: $p the number of points, and $r the radius in pixels. Alternatively, one could prepend list(,$r,$p)=$argv; and use command line arguments instead. Output will be a png, which should be piped to a file.

Output
$r=100; $p=5;

$r=100; $p=6;

$r=100; $p=7;

$r=100; $p=50;

HTML + JavaScript, 12 + 127 = 139 bytes
<canvas id=c

s=>r=>(g=n=>n?g(n-1,d.lineTo(r+r*M.cos(x=M.PI*2*n/s),r+r*M.sin(x))):d.fill())(s,c.width=c.height=r+r,d=c.getContext`2d`,M=Math)

Try it on Codepen
HTML (SVG) + JavaScript, 20 + 140 = 160 bytes
<svg id=c><path id=p

s=>r=>p.setAttribute(`d`,`M${M=Math,v=c.style,v.width=v.height=r+r},`+r+(g=n=>n?`L${r+r*M.cos(x=M.PI*2*n/s)},`+(r+r*M.sin(x))+g(n-1):``)(s))

Try it on Codepen

Japt canvas commands when?

Not my language, @Razetime and its creator hasn't been seen in about 2 years.

Ah, welp. Thought I might ask, since you wrote your own interpreter for it.

'Cause the official one was no longer fit for purpose ;) I have contributed a few features to Japt in the past but don't have write permissions on the repo to continue doing so.

Maybe I can help with writing a fork!

R, 42 bytes -25% = 31.5
function(n,r,p=r*1i^(4/n*0:n))plot(p,,"l")

Try it at rdrr.io
Calculates coordinates of vertices in the complex plane as  r times a power-series of the (4/n)th-root of i.
Example output of regular_polygon(7,3):

TI-80 BASIC, 25 bytes - 25% = 18.75
PARAM
2π/ANS->TSTEP
"COS T->X1ᴛ
"SIN T->Y1ᴛ
DISPGRAPH

Assumes all settings are set to the default values.
Run the program like 5:PRGM_POLYGON (for a pentagon)
It works by drawing a circle with a very low number of steps. For example, a pentagon would have steps of 2π/5 radians.
The window settings are good enough by default, and TMIN and TMAX are set to 0 and 2π, so all we need to change is TSTEP.

SmileBASIC 3, 183 159 - 25% = 119.25 bytes
Takes the sides and radius from INPUT, calculates and stores the points, and then draws them by using GLINE. I feel like this could be shorter but it's like 1 AM, whatever. Assumes a clean and default display env, so you might need to ACLS when running it from DIRECT.
INPUT S,R
DIM P[S,2]FOR I=0TO S-1
A=RAD(I/S*360)P[I,0]=COS(A)*R+200P[I,1]=SIN(A)*R+120NEXT
FOR I=0TO S-1GLINE P[I,0],P[I,1],P[(I+1)MOD S,0],P[(I+1)MOD S,1]NEXT

A byte is a byte, you can't say it's only a half.

Subtracting 25% rule.

OpenSCAD: 31 less 25% = 23.25
module p(n,r){circle(r,$fn=n);}

First post here! I know I'm late to the party, but this seemed like as good a question as any to start with. Call using p(n,r).

Welcome to the site!

APL (dzaima/APL), 50 - 12.5 = 37.5 37 - 9.25 = 27.75  bytes
P5.draw←{P5.G.ln ↑r+r×2 1○ᑈs÷⍨2×○0…s}

Shortened heavily with the help of The APL Orchard.
Explanation:
P5.draw←{P5.G.ln ↑r+r×2 1○ᑈs÷⍨2×○0…s}
P5.draw←{                           } Draw the following on the canvas every frame:
         P5.G.ln                      Draw a line using array(x1,y1,x2,y2...)
                                 0…s  Range from 0 to number of sides
                              2×○     times 2π
                           s÷⍨        divided by number of sides
                      2 1○ᑈ           Take cos and sin of each of the values from the left
                 ↑r+r×                Multiply the list by r and add r to center it,
                                      then mix the values of the list together

Previous version:
p←(2×○⍳s+1)÷s
P5.draw←{P5.G.ln r+r×⍉(2○p)↑⍤⍮(1○p)}

Takes input as variables r and s,  draws polygon with center at \$(r,r)\$.
Made with the help of the formula used here.
Outputs:
100 3

100 5

200 7

To execute the program, use the setup here, for a full view of the drawn polygon.

C# in LINQPAD
Credit for the math part goes to Geobits (I hope you don't mind!) with the Java answer. I'm hopeless at math :)
I did this in LINQPAD as it's got a built in output window. So essentially you can drag and drop the following in to it and it'll draw the polygon. Just switch it to 'C# Program', and import the System.Drawing lib into the query properties.
//using System.Drawing;

void Main()
{
// Usage: (sides, radius)
    DrawSomething(4, 50);
}

void DrawSomething(int sides, int radius)
{
    var points = new Point[sides];
    var bmpSize = radius*sides;
    var bmp = new Bitmap(bmpSize,bmpSize);
    using (Graphics g = Graphics.FromImage(bmp))
    {
        var o = radius+30;
        for(var i=0; i < points.Length; i++)
        {
            // math thanks to Geobits
            double w = Math.PI*2*i/sides;
            points[i].X = (int)(Math.Cos(w)*radius+o);
            points[i].Y = (int)(Math.Sin(w)*radius+o);
        }
        g.DrawPolygon(new Pen(Color.Red), points);
    }
    Console.Write(bmp);
}

ActionScript 1, Flash Player 6: 92 - 25% = 69
n=6
r=100
M=Math
P=M.PI*2
lineStyle(1)
moveTo(r,0)
while((t+=P/n)<=P)lineTo(M.cos(t)*r,M.sin(t)*r)

Python 2, 74 bytes - 25% = 55.5
Input is in the variables r,n. If included in the count, it would be r,n=input(), for 12 bytes more.
import math,turtle as t
exec"t.fd(2*r*math.sin(180/n));t.rt(360/n);"*n

Try it online - (uses different code since exec is not implemented in the online interpreter)

Matlab 58 bytes - 25% = 43.5
Saw no Matlab solution, so here is one which is pretty straightforward:
f=@(n,r) plot(r*cos(0:2*pi/n:2*pi),r*sin(0:2*pi/n:2*pi));

You can shave off some bytes if r and n are already in the workspace.
Example call:
f(7,8)

Python 2, 222 bytes
from math import*
def f(s,r):
 r*=cos(pi/s)
 v,R=2*pi/s,[(2*t)/98.-1for t in range(99)]
 print"P1 99 99 "+" ".join(["0","1"][all(w*(w-x)+z*(z-y)>0for w,z in[(r*cos(a*v),r*sin(a*v))for a in range(s)])]for x in R for y in R)

Checks if a pixel is on the inner side of all hyperplanes (lines) of the polygon. The radius is touched because actually the apothem is used.

SmileBASIC, 85 75 - 25% = 56.25 bytes
FOR I=0TO S
A=I/S*6.28N=X
M=Y
X=R+R*COS(A)Y=R+R*SIN(A)GLINE N,M,X,Y,-I
NEXT

Variables S and R are used for input.
Explained:
FOR I=0 TO Sides        'Draw n+1 sides (since 0 is skip)
 Angle=I/Sides*6.28     'Get angle in radians
 OldX=X:OldY=Y          'Store previous x/y values
 X=Radius+Radius*COS(A) 'Calculate x and y
 Y=Radius+Radius*SIN(A)
 GLINE OldX,OldY,X,Y,-I 'Draw line. Skip if I is 0 (since old x and y aren't set then)
NEXT

The sides are drawn using the color -I, which is usually close to -1 (&HFFFFFFFF white) (except when I is 0, when it's transparent).
You can also draw a filled polygon by using GTRI N,M,X,Y,R,R,-I instead of GLINE...

Mathematica 27 ( = 36 - 25%)
Graphics[Polygon[CirclePoints[r, n]]]

When we submit Mathematica code we often forget about new functions that keep getting built into the language, with current language vocabulary amassing around 5000 core functions. Large and expanding language vocabulary is btw quite handy for code-golfing. CirclePoints were introduced in the current version 11.X. A specific example of 7-sided radius 5 is:

Also you just need to enter angle parameter to control orientation of your polygon:
Graphics[Polygon[CirclePoints[{1, 2}, 5]]]

Tikz, 199 bytes
\documentclass[tikz]{standalone}\usetikzlibrary{shapes.geometric}\begin{document}\tikz{\def\p{regular polygo}\typein[\n]{}\typein[\r]{}\node[draw,minimum size=\r,\p n,\p n sides=\n]{}}\end{document}

This solution uses the tikz library shapes.geometric.
Here is what a polygon with 5 sides and radius 8in looks like when viewed in evince.

MATLAB/Octave, 26.25 bytes (35 bytes-25%)
@(n,r)polar((0:n)/n*2*pi,r+(0:n)*0)

Can be tested on octave-online.
@ptev already posted a MATLAB answer but mine uses far less bytes and isn't distorted.
We can save up another 6 bytes (or 4.5 including bonus) if we assume input can be given as variables r&n already existing in workspace - then just calling polar((0:n)/n*2*pi,r+(0:n)*0) is enough.
Also, example output (n=5,r=3):

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
I challenge you to generate the following sequence
I challenge you to generate the following sequence till 100 terms through any programming language in shortest characters possible.
The sequence is like this :-
1 2 3 4 5 10 20 30 40 50 100 200 300 400 500 ........

The output needs to be like this (above) only, nothing extra.
Remember, You can use + and - only and for mathematical calculations only (++ and -- are also allowed) and no other mathematical function like tan(), log(), pow(), ......etc.
Also, You cannot use any character variables in your code.

"You can use + and - only for mathematical calculations" So is this a [restricted-source] challenge?

Eh, seems easier to just treat them as strings and concat '0' each loop.

@algorithmshark can there be [restricted-source] + [code-golf]?

@MukulKumar Yes, that's allowed.

Wait a minute, if we can't use characters or strings, how do we output the numbers separated with spaces? Can they be newline separated instead?

@Doorknob You can use ASCII numbers, or string constants like \n I restricted only character variables and not constants.

Is something like n=int(str(n)+'0') in Python legal? It has no character variables.

@isaacg no character variables... valid

“You can use + and - only for mathematical calculations” – Does this mean that I must not use + and - for something other than mathematical calculations or does this mean that I must not use any other mathematical operators than + and -?

Although it's easy to guess which sequence you mean here, you haven't actually defined it. Any sequence of 100 numbers starting with the 15 you specify will be correct. For example: 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 10, 20, 30, 40, 50, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 100, 200, 300, 400, 500, ... probably isn't what you want.

The wording is causing confusion. Please clarify whether +,-,++,-- can be used for string operations. Also please explicitly state whether multiplication/exponentiation is allowed. VTC till then.

It is a similar ambiguous question as http://codegolf.stackexchange.com/questions/25938/challenge-to-generate-a-mathematical-sequence

@MukulKumar I'm curious what you were shooting for here. Did you mean you wanted only addition operators and no padding 0s at the end? IOW, would you have considered this 58-char perl solution to be correct? '$x=$i=1;for(1..20){print$x;print$x+=$i for 1..4;$i=$x+=$x}' Basically repeat { print(x); x += i; print(x); x += i; print(x); x += i; print(x); x += i; print(x); x += x; i = x }

BTW, the problem with the above in many languages is that you run out of 64 bit ints 4 numbers too soon.

25 chars in Matlab/Octave: x=[1:5].'*10.^[0:19];x(:)

GolfScript (21 chars)
If

You can use + and - only for mathematical calculations

means what it says then:
[6,1>~{4$10*}95*]' '*

If it is intended to say

The only mathematical operators you can use are + and -

then the multiplications can be replaced with string manipulation at the same character count:
[6,1>~{4$0`+}95*]' '*

Dissection:
[         # Start gathering values into an array
  6,1>~   # Dump the numbers 1 to 5 onto the stack
  {       # Beginning of loop body
    4$    # Copy the 5th item on the stack

Here the variants differ
    10*   # Multiply it by 10

or
    0`+   # Postpend '0'

And then merge again
  }95*    # Loop 95 times, so we end up with 100 items on the stack
]         # Gather those 100 items into an array
' '*      # Space-separate them

I don't know GolfScript but 4$10* # Copy the 5th number on the stack and multiply by 10 -- Only addition subtraction and (in|de)crements are allowed

@user80551, that's not clear to me, but it's easily worked around at the same character count.

Perl, 38 bytes
Disclaimer: The restrictions of the changed question are not too clear to me.
for$i(0..19){print$_.0 x$i.$"for 1..5}

The code uses variables with integer values except for $" which is used for the separation space. It can be easily replaced by ' ' (+1 byte).
Mathematical operations are not used, the code only contains string concatenations and the repetition operator.
The result are 100 numbers:
1 2 3 4 5 10 20 30 40 50 100 200 300 400 500 1000 2000 3000 4000 5000 10000 20000 30000 40000 50000 100000 200000 300000 400000 500000 1000000 2000000 3000000 4000000 5000000 10000000 20000000 30000000 40000000 50000000 100000000 200000000 300000000 400000000 500000000 1000000000 2000000000 3000000000 4000000000 5000000000 10000000000 20000000000 30000000000 40000000000 50000000000 100000000000 200000000000 300000000000 400000000000 500000000000 1000000000000 2000000000000 3000000000000 4000000000000 5000000000000 10000000000000 20000000000000 30000000000000 40000000000000 50000000000000 100000000000000 200000000000000 300000000000000 400000000000000 500000000000000 1000000000000000 2000000000000000 3000000000000000 4000000000000000 5000000000000000 10000000000000000 20000000000000000 30000000000000000 40000000000000000 50000000000000000 100000000000000000 200000000000000000 300000000000000000 400000000000000000 500000000000000000 1000000000000000000 2000000000000000000 3000000000000000000 4000000000000000000 5000000000000000000 10000000000000000000 20000000000000000000 30000000000000000000 40000000000000000000 50000000000000000000

Ungolfed:
for $i (0..19) { # 20 * 5 = 100 numbers
    for $_ (1..5) {
        print $_     # first digit
            . 0 x $i # zeros
            . $"     # separator (space)
    }
}

Not a bad solution. The shortest I could manage was 34: print 1..5,!($,="0$,"||$")for a..t

Python 60
r=range
for i in r(20):
 for j in r(1,6):print str(j)+'0'*i,

Thanks to @ace for pointing out that this was way too long.

Python 113
from itertools import*
i=j=0
for x in cycle(range(1,6)):
 i+=1;print str(x)+'0'*j,
 if i%5==0:j+=1
 if i>99:break

It should be shorter if you use two loops instead of itertools

for j in'12345' lets you omit the str() command, which brings you down to 51 characters, if you remove the first line and spell out range

@MrLemon j will then become a character variable which is not allowed.

@user80551 I totally overlooked that part, you are correct.

Use list comprehension and this will reduce to 47 characters [i*10**j for j in range(21)for i in range(1,6)]

@Abhijit Can't use multiplication or exponentiation.

GolfScript, 30 25 characters (26 23 newline separated)
;6,1>{.{10*}%}20*][]*' '*

Commented:
;         # pop the input string (empty)
6,1>      # generate [1 2 3 4 5]
{.{10*}%} # duplicate the array and multiply everything by 10
20*       # do this 20 times (5 * 20 = 100)
]         # wrap the whole stack in an array
[]*       # flatten
' '*      # join by space

I really don't like the repetition at the end, but GS doesn't provide a flat_map or flatten of any sort. Thanks @PeterTaylor for providing a way to flatten!
If we can separate by newlines instead of spaces, then 23 characters:
;6,1>{.{10*}%}20*][]*n*

You should create a programming language called DoorknobScript.

To get an array of 1 to 5 it's better to do either 6,(; or 6,1>. GS does provide a couple of ways to do one-level flatten: []* or {~}%. But to use either you'll need to remove the initial '' from the stack (which is currently giving you output with a leading space) or avoid including it by using an explicit [.

{.{10*}%} # duplicate the array and multiply everything by 10 Multiplying isn't allowed.

@user Where does it say that? Most of the other answers use multiplication too.

It says "Remember, You can use + and - only and for mathematical calculations only (++ and -- are also allowed)".   Doesn't "only" means ..... "only"?

APL (17 24)
,⍉10⊥¨(⍳5)∘.{⍺,1↓⍵/0}⍳20

Multiply and power are not allowed.

@user80551: ok I changed it

Java,185
class g {public static void main(String[] args){for(int x=0;x<20;x++){for(int i=1;i<6;i++){System.out.print(""+i); for(int j=0;j<x;j++){System.out.print("0");}System.out.print(" ");}}}}

You forgot a space between int and j so your code didn't compile. I edited your answer to fix that.

It's also an infinite loop rather than printing 100 terms.

Oh ok, sorry I'll edit it.

You can get it down to 169 by 1) renaming args 2) restructuring the loops and 3) declaring your ints up front : class G{public static void main(String[]a){int x=0,i,j;for(;x<20;x++)for(i=0;i++<5;System.out.print(" ")){System.out.print(""+i);for(j=0;j++<x;System.out.print("0"));}}}

Can't you remove the space just before the third for

Julia - 38
[print(i,"0"^j," ") for i=1:5,j=0:19];

Output:
1 2 3 4 5 10 20 30 40 50 100 200 300 400 500 1000 2000 3000 4000 5000 10000 20000 30000 40000 50000 100000 ...

-1 , multiplication and power are not allowed.

Now they are strings, so i think it doesnt break the rules

I just wrote the exact same solution before seeing yours.

PHP - 61
for($i=0;$i++<21;)for($j=0;$j++<5;)echo str_pad($j,$i,0).' ';

C, 93
i;main(j,k){for(;++i;)for(j=0;++j<6;){for(putchar(48+j),k=0;++k<i;putchar(48));putchar(32);}}

// it draws nice patterns on the terminal...

87 bytes


text:
Valid Through The Ages
Inspired by this question on SO, your task is to produce a program that is valid in (at least) two major versions of your chosen language that produce different output.
Rules

Any language that has more than one major version can be used.

For the purposes of this challenge, I would suggest a "major version" is where the first number in the version number changes.

PHP 4 and PHP 5 are different, PHP 5.3 and PHP 5.4 are not.

However, since I don't know the versioning scheme for all languages, if you can argue your case well enough, I'm sure the community will determine if you have been fair in determining "major version" yourself.

The code must be compiled and run with the same flags and input each time

Except to change the version of the language if this is pertinent

Errors don't count as output and answers that produce errors are disqualified (rather than error output is just ignored)
The program should take no input other than that required to make it run.
For each given version, the output should always be the same
The intention is that the change should be a consequence of a change in the language spec rather than the VM spec or environmental metadata

Scoring

code-golf type scoring for length, so +1 for each char/byte
-1 for each character difference in the length of the output.

e.g. Version 1 outputs abcde (5 characters), Version 2 outputs 123abc (6 characters) = -1

Other Rules

Standard exceptions apply - no external programs,web requests etc.
Your program should terminate (within 2 seconds)
Lowest score wins.

"Better" Scoring
Keep your original answers, in the interest of fairness, I'll mark the winner based on the original rules.
Since my original scoring is fundamentally broken, why not re-score / retry with the following scoring system:

code-golf type scoring for length, so +1 for each char/byte
+1 for each character difference in length of output

abcde and 123456 -> +1

-1 for each unique character difference in the output (capped to length of shortest output)

abcde and 123456 -> -5
12345 and 123456 -> -1
12345 and 123455 -> 0

Scores closest to zero win
In the event of a second tie break, simple code-golf score wins.

Note: in Ruby, the first number is the epoch, it signifies major events in Ruby's history, not a version number (0->1 was the initial release, 1->2 was Ruby's 20th birthday). The major number is the second number. So, Ruby 1.8->1.9 would be crossing a major release.

I think the new scoring is too different from the original, it's practically a new question

I'd say the PHP example is arguable, 5.4 has quite a few basic features that would break on 5.3 (traits, []arrays, array dereferencing). It was going to be PHP6, but then decided to save the 6 to something more radical as unicode strings by default IIRC

@James Webster thanks to the new scoring rules ;) Now I perfectly get a score of 0.

What is the unique character difference? If I output zzzz and aaaa, does that give me -4? That's what it seems like to me.

So, assuming that the program can detect in which version it runs, the winner is who can output the most characters in two seconds? I think this question would be better as a popularity-contest to encourage people to find interesting and subtle language bugs.

"Scores closest to zero win" - NONONONO this should be "lowest score wins", since it would be very simple to score negative.

@AJMansfield, That was the problem with the original scoring. Too many people had -∞ scores.

Revised answer for "better" scoring system
C89 / C99, Score: 0
My program is 52 characters long and uses the same mechanism as in my original answer to achieve the different output. This works because C89 doesnt treat // as a comment:
i=32;main(){putchar(i+++0//**/
+52)&&i<84&&main();}

The results:
$ ./diff2c89
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS
$ ./diff2c99
TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂Çüéâäàåç
$ ./diff2c99 | wc
      0       1      52
$ ./diff2c89 | wc
      0       1      52
$ wc diff2.c
      1       2      52 diff2.c

Old answer:
C89 / C99, Score: -Infinity?
I'm not entirely sure if this program doesn't break the rules, but never mind.
This program exploits the fact that in C89 // is not a valid comment but /* ... */ is.
Using the comment trick an other function is executed. In C89 the function just prints "trolololol..." until the stack overflows (so it might finish within 2 seconds).
f1(){printf("ol");f1();}
f2(){printf("oll");}
main(){
    printf("tr");
    void (*f[])() = {f1,f2};
    f[0 //* trollololol */
      +1]();
}

C99
$ ./diffc99
troll

C89
$ ./diffc89
trolololololololololololololololololololololololololololololololololololololololololo
lolololololololololololololololololololololololololololololololololololololololololol
ololololololololololololololololololololololololol ....

I'm not sure either whether it's against the rules, but I like it :)

According to the "better rules", Scores closest to zero win so this is actually very far from zero.

Indexing an array of function pointers by either division or addition depending on the C standard's definition of comments... beautiful.

Python - 10 points less than the next best answer
print(range(100))

In Python 2, this will print the entire list of integers from 0 to 99.
In Python 3, range is a generator and so it will print only "range(0,100)".
Seeing as I've never run into a size limit on numbers in Python, I can replace that 100 with a much bigger number (2**1000, for example) and end up with a virtually infinite difference in the output.
Edited to reflect the fact that, while I can get a score that is infinitely low for any practical purpose, I cannot reach actual infinity with a program that terminates under 2 seconds
For the updated tie-breaker scoring system, I'd submit:
print(range(4))

Output:
Python 2: [0, 1, 2, 3]
Python 3: range(0, 4)
The first print has 5 unique characters ([123]), the second print has 8 unique characters (range(4)), the difference in length of output is 1, the code has 15 characters, the shortest output is 11 characters... these rules are pretty confusing but I think this brings me to a final score of 15+1-min(11,5+8) = 5.

However, "your program should terminate", even on a very (finitely) fast machine, your "much bigger" (finite) number is still nowhere near -∞ so I dispute your score (give or take ;] )

@JamesWebster Thank you for bringing this terrible technical mistake to my attention, I have edited my answer accordingly ;)

Other similar answers will surely come. I guess that scoring for these answers should be calculated on how fast they get to infinity.

@Vereos I'd hope that, if other answers of this sort show up, the question will be edited with additional scoring details.

@Tal, Do you have any suggestions on better scoring before more answers are posted? Only yours has exploited this so far?

@JamesWebster At the risk of making myself lose, I'd say that in the event of having two "minus infinity" scores, the length of the code could serve as the tie breaker.

Six answers have exploited this so far and only one didn't ;) Gaurang Tandon posted the only answer that can't produce arbitrary scores.

@foobar Yes, I think that the best tie breaker should be who was first 0:)

@Tal I think everyone who reads the scoring rules will make up a solution that can produce negative scores, only limited by the language or hardware, before having read any answer to the problem ;) The scoring is just broken by design...

The scoring is just broken by design I'm afraid this is true :(

So Python3 has range do what xrange did in Py2? Man, I didn't know that.

Python - 0 points
No idea how this one works :P Just stumbled upon it while trying out random code.
int

On Python 3, it's <class 'int'> and on Python 2, it's <type 'int'> (using interative console)
"Better" Score: 3 (length) + 1 (char diff.) - 4 (unique chars)
Older Python 1 - 7 points
print()

Big thanks to @grc for this version and helping me subtract four points !
In Python 2, this statement is interpreted as print () which prints the empty tuple ().
In Python 3, the print is a function and results in nothing being printed.
"Better" Score: 7 (length) + 2 (char diff.) - 2 (unique chars)
Older Python 2 - 13 points:
print(1,2)

"Better" Score: 12 (length) + 2 (char diff. o/p) - 1 (unique chars o/p)
I know this isn't going to win but still gave an answer, as this is my first Python try :)

I think this could be shortened to print().

@grc Thanks a lot for the advice ! Looking back at my compiler, I see that I had tried it, but was so lost in the docs, that I deleted it to try dict.itertools() :P

C#
I also changed the generic method type inference algorithms between C# 2, 3 and 4. For example:
using System;
class C
{
  static int M<T>(T x, T y) { return 1; }
  static int M(object x, object y) { return 2; }
  static void Main()
  {
    Console.WriteLine(M(1, new int?()));
  }
}

In C# 2 method type inference says that T cannot be both int and int?, and so produces 2. In C# 3 method type inference says "the best compromise between int and int? is int?" and so chooses M<int?> and produces 1.

> I also changed What do you mean you changed the... oh. OH.

Ruby, 4 characters + 0 char length difference - 3 unique char difference = score of 1
p ?d

On Ruby 1.9, it will print "d". On 1.8, it prints 100.
Explanation: ?d is "d" in 1.9 and 100 (the ASCII code for d) in 1.8. p x is equivalent to puts x.inspect. * is both string repetition and multiplication.

"Optimized" version for old scoring:
Ruby, 8 characters - 999999989 chars difference = score of -999999981
p ?!*1e9

Prints 33000000000.0 for 1.8 and "!!!!!!...!!!" for 1.9. (?! is 33 in 1.8 and "!" in 1.9, and * is both string repetition and multiplication.)
Really, you could go as far as you wanted with the multiplication, it just depends on how fast your computer is.

Could you explain what exactly is happening in that second line?

@Tal Okay, edited

Bash — -∞ (up to practical limits)
Effectively, however much memory you have. E.g. with about 10GB:
echo {0..999999999}

Bash 2: doesn't support ranges in brace expansion, so prints {0..999999999}.
Bash 3:

Any language — -∞ (up to practical limits)
You'll have this in pretty much any language, even if it ends up being a little more complex. As soon as you can make two different values, you can write code that produces arbitrarily different output. A better scoring method would ignore the differences in the output.
version = … # some arbitrarily weird stuff
if version = 2:
    while not timed_out():
        print "version2"

@foobar The … in the “any language” version stands for whatever tricks you use to make your program depend on achange in the language spec. It is version detection, whether you do if $version >= 3 or if isinstance(range(0),list).

C#
Following code would produce the different output for C# 5.0 and previous versions of C#
using System;
using System.Collections.Generic;

namespace TestConsoleAppClosure
{
    class Program
    {
        static void Main(string[] args)
        {
            var actions = new List<Action>();
            List<int> list = new List<int> { 10, 20, 30, 40 };
            foreach (var item in list)
            {
                  actions.Add(() => Console.WriteLine(item));
            }
            foreach (var act in actions) act();
        }
    }
}

Output: C# 5.0
10
20
30
40

Output: C# 4.0
40
40
40
40

The reason is explained in this blog post by Eric Lippert: Closing over the loop variable considered harmful.

Python, -14 Points ( 3 - 17 char length difference = -14)
2/3

Python 2 outputs: 0
Python 3 outputs: 0.6666666666666666
Better Scoring version, 5 points (3 + 2 char length difference = 5)
3/2

Python 2 outputs: 1
Python 3 outputs: 1.5

C#
I added covariance and contravariance to C# 4, so programs of the form:
using System;
using System.Collections.Generic;
class C
{
  static void Main()
  {
    Console.WriteLine((new List<string>()) is IEnumerable<object>);
  }
}

Would produce false in C# 2 and 3 and true in C# 4.
However, one might argue that this does not count because the library containing the definition of IEnumerable<T> also had to change.

C++98/11 - "Better" Scoring (115 characters - 115 unique character differences in output = score of 0)
A slightly edited version to comply to the new scoring rules
Golfed:
#include<cstdio>
#define u8 "\x0B"
int main(){int i=116;char c[i];c[--i]=0;while(i-->0)c[i]=u8"\x7E"[0]+i;puts(c);}

Ungolfed version:
#include <cstdio>
#define u8 "\x0B"
int main() {
    int i = 116;
    char c[i];
    c[--i] = 0;

    while(i-- > 0)
        c[i] = u8"\x7E"[0] + i;

    puts(c);
}

The new solution doesn't differ much to the old one. In the new solution the output in both C++11 and C++98 is with 116 characters equally long, but the only character they have in common is the new line character appended by the puts function.
For C++98 the u8 in u8"\x7E"[0] will still be replaced, but now with "\x0B". So the resulting value after preprocessing will be "\x0B""\x7E"[0]. The two strings will be concatenated to "\x0B\x7E" and the subscript operator will access the first element, in this case the character with the value 11 in the character encoding. Additionally the value of i will be added, which intially is 114. So the character with the value 125 will be written to the resulting array. As i goes to zero all values from 125 to 11 will be written to the array and puts will print all characters with the values from 11 to 125, plus the trailing new line.
In C++11 u8"\x7E"[0] will be interpreted as an UTF-8 string consisting of the single character with the hexadecimal value 7E. The subscript operator will now access this character and the value of i is added to it, resulting in the decimal value 241 during the first iteration. While i goes to zero, all the values down to 126 will be written to the array and puts will print the characters with the values from 126 to 241, plus the trailing new line.
Depending on the used character set, this will produce different results, as most character sets only have the first 128 characters in common.
For ISO-8859-2 the output would be the following:
C++98:

C++11:

C++ (106 characters - 107 difference in output = score of -1) (OLD RULES)
Golfed:
#include<cstdio>
#define u8 "f"
int main(){int i=108;char c[i];c[--i]=0;while(i-->0)c[i]=u8""[0];puts(c);}

Ungolfed version:
#include <cstdio>
#define u8 "f"

int main() {
    int i = 108;
    char c[i];
    c[--i] = 0;

    while(i-- > 0)
            c[i] = u8""[0];

    puts(c);
}

Compiled with g++ -std=c++98 main.cpp and g++ -std=c++11 main.cpp.
Actually you can replace 108 with any positive number in integer range to achieve negative scores. As long as it's bigger than 108 ;)
In C++98 #define u8 "f" will cause the preprocessor to replace u8""[0] with "f"""[0]. This will result in "f"[0], which finally becomes the single character 'f', which is written to an array.
puts(c) will print the resulting array, consisting of i-1 'f'.
In C++11 u8""[0] will cause the empty string to be interpreted as an UTF-8 string, so no string concatenation is done.
As this is a C-string, the subscript operator will access the terminating null-byte and write it to an array.
In the end puts(c) will print the resulting array, which consists only of null-bytes. But as puts stops reading the input as soon as it encounters a null-byte, it will only print a newline and nothing more.

I get your score to be 1. Both c++89 and c++11 output a ? (on my (Mac) system at least)

Though I only count 115 characters in the solution.

@James Webster true, wc -c lied to me ;) I'll append a newline to the end of my solution ;) ...Or just adjust it.

@James Webster I guess that you're using UTF-8 encoding in your terminal. As the most significant bit in a byte is reserved in UTF-8, it can't map the characters the program outputs in the range from 128 to 232. So you should see up to 104 '?' or less with binary trash in between. With WINDOWS-1256 encoding as an example, your terminal would display this for the C++11 version: tuvwxyz{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌ں ،¢£¤¥¦§¨©ھ«¬®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهو

For the C++98 version it's possible that your terminal displays '?' for values below 32 as that are control characters. My terminal for example replaces most of them with a square and their hexadecimal value printed into it. Except for the new line and tab characters as examples. But now that I mention it myself. the C++98 version contains new line twice, but that's easy to fix ;)

I solved the problem with the two new lines by starting at the 11th character, as the 10th is the new line in any character set I know. So now all characters except for the trailing new lines in both outputs are unique. If there are '?' or other symbols displayed in the output several times, then it's due to the character set not containing a character with that number or it might be a control character. To solve that problem one has to change the character set in the terminal window.

@James Webster would be nice if you can confirm the score to be 0 now, or if you still see a problem in the solution. Thanks =)

Yes, that would make your score 0

CSS2 vs CSS3 48 points
<i style='font-feature-settings:"smcp" on;'>abcdefghijklmnopqrstuvwxyz</i>

Rendered as ABCDEFGHIJKLMNOPQRSTUVWXYZ (small caps) on CSS3 browsers
Rendered as abcdefghijklmnopqrstuvwxyz on non-CSS3 browsers
74 chars - 26 unique chars difference = 48

But this is an error in CSS2. I thought errors didn't count.

@MrLister AFAIK font-feature-settings has been introduced in CSS3 http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings

Python - 0
a='a=%r\ntry:print a%%a\nexcept:pass'
try:print a%a
except:pass

Python 2 prints a quine, while Python 3 prints nothing.
EDIT: Updated, fixed.

Can your computer really print ~9 billion digits in 2 seconds?

@JamesWebster This is actually the return value of a function - thus, it only needs to exist in memory for the program to finish. It requires a /lot/ of RAM, but it would finish within 2 seconds on a well-specced computer.

Perl, 24 characters - (9*(10^9))-1 char difference = score of -((9*(10^9))-1)+24
print$]>=5?"a":"a"x9e9;

Prints 9e9-times a for all versions below 5, prints a for all versions above 5. You could make the score infinitely low by just adding more as to the second output.

In the question: "The intention is that the change should be a consequence of a change in the language spec rather than the VM spec or environmental metadata"

I'm not using any VM spec or environmental metadata. Just the installed version.

Befunge, 36 - 378 = -342;  164 - 2576 = -2412
"v
"<v
" <v
"  <v
"   <v
 <v:,<
 ^_@

In Befunge 93, this would output 3 spaces, followed by <v, followed by 76 spaces, followed by <v, then 76 space, then <v, then 76 spaces, then <v followed by 77 spaces, then v followed by 78 spaces. Length: 3 + 2 + 76 + 2 + 76 + 2 + 76 + 2 + 77 + 1 + 78 = 395This is trivially extendable by adding extra lines similar to the first 5 lines.
In Befunge 98, this would output  <v  <v  <v <v  v.
The difference in length: 395 - 17 = 378. So the score would have been (by the old rules): -342
Note: I could have gotten an even bigger difference if I used . instead of ,; the difference would have been -684

Rule change:
This is a bit more tricky.
"  "-v>"Befunge 93 very long strings"v>"F"0g" "1-`!#v_   "F"0g1-"F"0pvz
     _^p0"F"-1g0"F"_v#    `-1" "g0"F"<^"j++a81zzzzzz]zzzzzzzzzzzzzzz"<
             _@#`0:,<

Befunge 93 output:
sgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeBsgnirts gnol yrev 39 egnufeB

Befunge 98 output:
j++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzzj++a81zzzzzz]zzzzzzzzzzzzzzz

Lengths: 2576. None of the characters between the strings are the same, so if I understood the challenge correctly, my score is 164 - 2576 = -2412 (yes I was supposed to aim for 0, but this was more fun). If I need to make it so that each character in each string are unique and different from each other, I can do so, please tell me.

Powershell, "Better" scoring, -163 (15 - 178 char diff = -163 )
$PSVersionTable

Powershell V2
Name                           Value
----                           -----
CLRVersion                     2.0.50727.5477
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

Powershell V3
Name                           Value
----                           -----
WSManStackVersion              3.0
PSCompatibleVersions           {1.0, 2.0, 3.0}
SerializationVersion           1.1.0.1
BuildVersion                   6.2.9200.16398
PSVersion                      3.0
CLRVersion                     4.0.30319.1022
PSRemotingProtocolVersion      2.2

JavaScript (ES3 vs ES5) - 9 points
length 10 + length difference 0 - output difference 1
[].map?1:0

Outputs 1 for modern browsers that support Array.prototype.map. Outputs 0 on older browsers. I tested this with IE8.
With old rules: 0 points
length 26 - length difference 26
Array([].map?27:0).join(0)

Outputs 00000000000000000000000000 on modern browsers. And empty string on old.

IE8 does really support ES4???

I rather was surprised how they did implement a non-existing standard…

Whoops! Fixed :)

Java (around -2.000.000.000)
The Java versions are sometimes called 1.x, but I think it still is within the rules.
The easy way is to check whether a class exists that was introduced in  a specific version.
try {
    Class.forName("java.lang.AutoCloseable");
    // Java 7 or later
    char[] text = new char[Integer.MAX_VALUE];
    Arrays.fill(text, 'a');
    System.out.println(new String(text));
} catch (Exception e) {
    // Java 6 or earlier
    System.out.println("-");
}

(Depends a bit on your terminal whether it is possible to output 2 billion characters in two seconds / For the new scoring, replace Integer.MAX_VALUE with the byte count of the program to achieve perfect zero score.)
This code depends on the version of the VM/JDK that is used (does that count?)
import java.lang.reflect.Field;
import java.util.Arrays;

{
    Field fValue = null;
    for (Field f: String.class.getDeclaredFields()) {
            if (f.getName().equals("value")) {
                    fValue = f;
            }
    }
    char[] text = new char[10];
    Arrays.fill(text, 'a');
    String s1 = new String(text);
    String s2 = s1.substring(1);
    fValue.setAccessible(true);
    text = (char[]) fValue.get(s2);
    Arrays.fill(text, 'z');
    System.out.println(s1);
}

It prints zs  for Java 6 and earlier JDKs and as for recent versions.

 PHP, Score: 0 (best case)
srand(2);echo rand();

Wow, this is going to be fun to explain.
According to this website, the srand() function appears to be broken from PHP 5.1.5 to PHP 5.3.14. Therefore, we are going to keep under consideration PHP 4.4.9 and one random version of PHP 5 that falls in the version interval specified above.
PHP 4.4.9 output: 1505335290
I don't think this is rule-breaking; Since this appears to be a bug, the output should be the same, but it's not. Our other PHP version will simply skip the srand() function and output a random number.

C++98/C++11
#include <iostream>

int main()
{
  for (long i = 0; i < __cplusplus; ++i)
     std::cout << "x";
}

For a standard conforming C++98 compiler, this outputs 199711 times the letter 'x', while for a standard conforming C++11 compiler, this outputs 201103 times the letter 'x'. The length difference of the output is therefore 1392 characters. This means that actually golfing the source code is not worthwhile, since a much larger effect can be achieved by just replacing "x" with a longer string, or by multiplying __cplusplus with some number.

TI-Basic 83 Plus vs. 84 Plus, score 5-1 = 4
length("setTime(

Outputs 2 on the TI-83 Plus, where the same program is parsed as something that looks like length("?►DMS because the setTime( command had not yet been introduced. So the string contains two 1-byte tokens, its length is 2.
Outputs 1 on the TI-84 Plus, because a string containing a single 2-byte token has length 1.

APL (5 - (1988894 - 1) = -1988888)
In old-style APLs (like Dyalog if ⎕ML=0*), ↑ means mix, which, on a 1-dimensional vector does nothing. In APL2-style APLs, like GNU APL, (or Dyalog if ⎕ML=3), ↑ means first, which takes the first item of a vector.
Thus, the following 5 bytes (the APL charset does fit in a byte),
↑⍳3e5

will output 1988894 bytes (the space separated list of numbers from 1 to 3e5) in old-style APL dialects,
and 1 byte (just the first number in said list, which is 1 and therefore of length 1), in APL2-style APL dialects.
Notes:

⎕ML means migration level. In Dyalog APL, the higher you set ⎕ML, the more APL2-style features are enabled. It defaults to 0. (And it's a global variable! Fun!)
3e5 was the highest 3-character value Dyalog APL would accept with ⍳. 4e5 gave me a LIMIT ERROR. This restriction is probably interpreter-dependent. (GNU APL had no trouble with higher values.)

Bash 7 (14 bytes program length + 0 difference in output length - 7 difference in unique chars in output)
Related to @Gilles answer, but a different expansion feature and different versions.  Scoring according to the edited question:
echo {1..9..2}

Output for bash 3.x:
{1..9..2}

Output for bash 4.x:
1 3 5 7 9

C89/C99 comment exploit, 45 character, 0 score
main(a){while(++a<47)putchar(79-a//**/~0
);}

c89 output
QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} - 45 char.
c99 output
MLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! - 45 char.

This in fact uses exactly the same logic as the other C answer.

I mean, considering the fact that there is already an answer of this question using the exact same language and the exact same logic, this answer is not very interesting.

This entry is superior to the initial 'other C answer' on multiple levels. It's shorter, scores perfect, completes in under two seconds, and doesn't crash or abort. As far as the updated version... in fairness you should probably leave a comment linking this code.

Your answer is better than the "initial" other C answer because that other C answer was submitted BEFORE the rule change.

Maybe, but the updated version rips my implementation. Not only does it use the same offsets and switch from printf to putchar; most damning is that for r5 I misread the rules and accidentally combined new and old scoring. Output for [r5,r6] is an error. r3 in the other C answer contains the exact same error. If you look at the timestamps, you'll see it was r5 that was posted here when the other answer updated. Not that it matters, since this is code golf, and this entry satisfies the challenge in fewer characters, period.

PHP: −134217684 (43 - 134217727)
echo str_pad("",ip2long("")&0x7ffffff,"a");

Usage:
time php -r 'echo str_pad("",ip2long("")&0x7ffffff,"a");' > /tmp/test
1.61user 0.17system 0:01.79elapsed 99%CPU (0avgtext+0avgdata 142272maxresident)k
0inputs+0outputs (0major+35922minor)pagefaults 0swaps

In PHP5+ this will print nothing since ip2long with invalid argument turns into false which casts to zero. In PHP4 it ip2long("") returns -1 and we pad the empty string with 128MB og a.
The mask is fitted so that it returns long before the 2 seconds on my machine. If you can't make it in 2s buy better hardware!
With new rules: 0 (40 - 40. You can't get any closer to zero.)
echo str_pad("",40,chr(97+ip2long("")));

Outputs:
In PHP4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
In PHP5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

With the new scoring rules your score is 39. Both outputs are equally long, so no penalty for that. But there's only one unique character difference. a is not equal to b, so you are allowed to subtract -1 from your score.

SmileBASIC 3 / SmileBASIC 2, Score: -5 (original scoring)
?1E9

In modern versions of SB, this prints 1000000000 as expected, but in version 2 and earlier it printed 10 due to a bug.

Go 1.9->1.10. Score = 1 - 1 = 0
From 1.10 notes:

There is no longer a limit on the GOMAXPROCS setting. (In Go 1.9 the limit was 1024.)

package main
import (r"runtime")
var g=r.GOMAXPROCS
func main() {g(10340)
print(g(0))}

1.8: 256
1.9: 1024
1.10: 10340

ARMv4T/ARMv5TE+ with libc, pop {pc} bug, for old scoring system, 42 40 bytes, old score -4294967252 -4294967255
1009 e28f 4002 e92d e001 e04f f004 e49d
e002 e201 ff11 e12f 4674 2021 f7ff fffe
3401 d1fa bc01 4700

ARMv4T, the ISA used in the ARM7TDMI, famous for powering the Game Boy Advance, introduced the Thumb instruction set.
It is a 16-bit (later mixed with 32-bit) instruction set encoding that is more compact, but more limited, than the standard 32-bit ARM instruction set. I write a lot of my golfs in it, because it is torture fun.
Basically, the idea is, since ARM instructions are always 4 byte aligned, if you jump to an odd address, the CPU will switch to Thumb execution mode at the address rounded down, and vice versa for an even address.
One cool thing that ARM lets you do is pop the return address directly into the program counter from the stack, resulting in incredibly easy stack cleanup (similar to leave; ret in x86, but you can pop ALL registers at once)
        push    {..., lr} @ put the return address in the link register on the stack
        pop     {..., pc} @ pop the return address into the program counter to return

On ARMv5TE and later, this will magically switch between ARM and Thumb state.
However, ARMv4T had an infamous bug here.
They forgot to implement Thumb switching: pop {pc} will ignore the lowest two bits and not switch to Thumb mode. Source: ARM docs
So all we have to do is write a polyglot that will do something different if it is in ARM or Thumb state, which is easy because the encodings are entirely different.
        .text
        .arm
        .globl main
main:
        add     r1, pc, #9
        push    {r1, lr}
        sub     lr, pc, r1
@ define to simulate ARMv4T behavior
#ifdef SIMULATE_ARMV4T
        b       simulate_armv4t_bug
#else
        pop     {pc}
#endif
.Larmv4t_polyglot:
        and     lr, r1, #2      @ b     .Lthumb_entry; (skipped)
        bx      r1

        .thumb
.Lthumb_entry:
        mov     r4, lr
.Lloop:
        movs    r0, #'!'
        bl      putchar
        adds    r4, #1
        bne     .Lloop
        pop     {r0}
        bx      r0

#ifdef SIMULATE_ARMV4T
        .arm
        .align 2
simulate_armv4t_bug:
        pop     {r12}
        @ clear thumb bit
        bic     r12, r12, #3
        bx      r12
#endif

This program starts in ARM state.
We need r1 to contain the address of .Larmv4t_polyglot, with the Thumb bit set. (So .Larmv4t_polyglot | 1, or .Larmv4t_polyglot + 1)
Therefore, we add 9 to the program counter (which points 8 bytes after the currently executing instruction because of questionable design decisions) to get 16 bytes, or 4 instructions, ahead, with the Thumb bit set.
        add     r1, pc, #9

Push r1 and lr to the stack. The former is so we can perform the pop {pc} bug, and the latter is to save the return address so we can use lr as a temp register and make function calls.
        push    {r1, lr}

Subtract r1 from pc. This results in lr being -1.
        sub     lr, pc, r1

Then, we pop the value from r1 into the program counter.
An ARMv5+ processor will execute the polyglot in Thumb mode, but an ARMv4T processor will ignore the low 2 bits (rounding down) and execute .Larmv4t_polyglot as ARM code.
To simulate the buggy behavior, define SIMULATE_ARMV4T which will replace pop {pc} with a veneer that jumps to that address in ARM mode.
        pop     {pc}

Now, it is time for our polyglot.
ARM mode: Set lr to 0 by setting it to r1 & 2. Since that contains the address of .Larmv4t_polyglot plus one, we know the second bit is clear.
Then, jump to the polyglot again on ARMv4T (the address is still in r1), this time using bx, which DOES switch to Thumb mode.
.Larmv4t_polyglot:
        and     lr, r1, #2
        bx      r1

Thumb mode: Jump to .Lthumb_entry.
.Larmv4t_polyglot.thumb:
        b       .Lthumb_entry
        @ skipped

Now, we are in Thumb mode on both machines, we can do our output loop.
We first need to make a copy, because lr will be overwritten.
      mov     r4, lr

Then, we loop calling putchar('!'), until r4 += 1 == 0.
.Lloop:
        movs    r0, #'!'
        bl      putchar
        adds    r4, #1
        bne     .Lloop

On ARMv5TE+, r4 will be -1, so the loop will only run for one iteration, but on ARMv4T, r4 will be 0, so it will run 4294967296 times (0x100000000) until it wraps back around to zero.
I could technically make this infinite, but the rules say that it must eventually finish.
Equivalent C:
uint32_t r4 = lr;
do {
    putchar('!');
} while (++r4);

Finally, do an ARMv4T compatible return using the "Thumb interworking" hack: We pop into a low register and bx to it to return from main.
        pop     {r0}
        bx      r0

Program size: 40 bytes
Output length in ARMv5TE+: 1 byte
Output length in ARMv4T: 4294967296 bytes
Score: -4294967255
ARMv4/ARMv5TE+ with libc, same bug, for new scoring system, 42 bytes, score 0
Mostly the same, but instead of dumping near-infinite '!'s, both will dump 42 bytes to stdout. However, for a maximum negative score, all you have to do is change movs r5, #42 to movs r5, #128 for a score of -86.
Machine code:
1009 e28f 4002 e92d e080 e3b0 f004 e49d
e002 e201 ff11 e12f 252a 4676 19a8 f7ff
fffe 3d01 d1fa bc01 4700

(ARMv4T simulator left out, it is the same)
Assembly:
        .text
        .arm
        .globl main
main:
        add     r1, pc, #9
        push    {r1, lr}
        movs    lr, #128
        pop     {pc}

.Larmv4t_polyglot:
        and     lr, r1, #2      @ b     .Lthumb_entry; (skipped)
        bx      r1

        .thumb
.Lthumb_entry:
        movs    r5, #42
        mov     r6, lr
.Lloop:
        adds    r0, r5, r6
        bl      putchar
        subs    r5, #1
        bne     .Lloop
        pop     {r0}
        bx      r0

The main differences are that instead of initially setting lr to -1, we set lr to 128, and that our print loop will always run 42 times, subtracting 1 from the char it prints each time.
The equivalent C loop looks like this:
uint32_t r5 = 42, r6 = ARMv4T ? 0 : 128;
do {
    putchar(r5 + r6);
} while (--r5);

ARMv5TE+ output
termux ~/golf $ clang -m32 valid-through-the-ages.S
termux ~/golf $ ./a.out | hexdump -C | cut -d' ' -f 3-19
aa a9 a8 a7 a6 a5 a4 a3  a2 a1 a0 9f 9e 9d 9c 9b
9a 99 98 97 96 95 94 93  92 91 90 8f 8e 8d 8c 8b
8a 89 88 87 86 85 84 83  82 81

ARMv4T (simulated) output:
As stated before, the compiler option is just to emulate the bug on my device. It is not needed on actual hardware.
termux ~/golf $ clang -m32 valid-through-the-ages.S -DSIMULATE_ARMV4T
termux ~/golf $ ./a.out | hexdump -C | cut -d' ' -f 3-19
2a 29 28 27 26 25 24 23  22 21 20 1f 1e 1d 1c 1b
1a 19 18 17 16 15 14 13  12 11 10 0f 0e 0d 0c 0b
0a 09 08 07 06 05 04 03  02 01

Program size: 42 bytes
Difference in output length: None
Differing bytes: 42.
Score: 0


text:
Using dictionaries, thesauruses, and similar databases, construct as large of a "See also" loop as possible
As I'm sure many of you know, synonyms can range from very similar to not-so-similar-but-I-can-see-how-it's-similar. It's common for dictionaries to use "See also" to denote occurrences of words that have especially good synonyms. Thesauruses (Thesauri?), on the other hand, list every word that is remotely close in definition. It got me thinking: Is it possible to construct one single "See also" loop that encompasses an entire dictionary?
Of course, you'd have to stretch definitions at some point. Switches between parts of speech would also have to happen if you intend to make your loop large. The only rules are that each must reference EXACTLY the word after it only with respect to spelling, and the final word must reference the first word. For example:

Huge: See also Giant
Giant: See also Titan
Titan: See also Behemoth
Behemoth: See also Beast
Beast: See also Creature
Creature: See also Pig
Pig: See also Gorge
Gorge: See also Void
Void: See also Free
Free: See also Unrestricted
Unrestricted: See also Huge

That was just thrown together, but I think it gets the idea across. You can go for "words" that are really multiple words, so long as it is the type of thing you'd find in a dictionary.
Some helpful resources (let me know of any others):

http://thesaurus.com/
http://wordnetweb.princeton.edu/
http://icon.shef.ac.uk/Moby/

And that's it! As for going above and beyond, it would be cool to see some kind of visualisation of your loop, possibly making each part of speech a different color or something. Use your imagination! It will be interesting to see what kind of stuff you might come up with.
Winning criteria: The program which produces a loop that contains the largest number of unique words will be deemed the winner.

so, we're asked to fetch an online resource (which probably won't like us to do so), parse it into a huge graph, and find a hamiltonian cycle or prove there is none (which will take a lot of time)? What are the winning criteria? Popularity? Even if so, what should we strive for?

Winning criteria is the longest loop, as long as it follows the rules. I'm going to be honest that I don't know much about fetching information from online resources, but I didn't think it would be too much of any issue. I'm willing to bet that tons of websites and programs already scour spelling/definition databases constantly.

I don't think there have been questions about the largest cycle in a graph before; and the issue of getting a source graph is fixable using the Moby thesaurus, but there are two major issues: one, any complete solution is unlikely to finish running in your lifetime; and two, that means that your proposed scoring system is hard to evaluate. You could perhaps ask for the longest cycle found within a time limit, but then you run into problems with non-determinacy and with different performance charactistics on different computers.

I expected there to be issues like this... I wanted people to try and come up with solutions that would actually be possible with the equipment they might have. I know there's probably a "perfect" way of doing this that would require crazy amounts of computing and time, but I'd just ask that people use their best judgment about the solution they choose. I agree that there's no good way of normalizing the score for computer speed, but I can't think of any other good way to choose a winner besides simple length of the loop.

This question appears to be off-topic because it is an English contest, not a programming contest.

Is it necessary to specify that the challenge is to "Create a program that will..."? I figured that was heavily implied.

"Of course, you'd have to stretch definitions at some point." Is it even possible to create a program that can stretch definitions?