Skip to main content
strikethrough on old score
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

Prolog, 371 371 362 - 11 = 360351 bytes

My first attempt at code golf.
I chose a language which seem to be underrepresented here.
I'm far from an expert at prolog, so this can most likely be improved a lot.
I did not go for any optional bonuses. I tried for the 15% one but it cost me more than I gained.

    a(z,['MEDIC!','Thanks!','Go Go Go!','Move Up!','Go Left','Go Right','Yes','No']).
    a(x,['Incoming','Spy!','Sentry Ahead!','Teleporter Here','Dispenser Here','Sentry Here','Activate ÜberCharge!','ÜberCharge Ready']).
    a(c,['Help!','For Pony!','Cheers','Jeers','Positive','Negative','Nice Shot','Good Job']).
    r:-repeat,read(X),read(Y),a(X,Z),nth1(Y,Z,A),writelnwrite(A),fail1=2.

##Try it out You can try it out online here.

  1. Create new program
  2. Paste code
  3. As query, just use 'r' without quotes.

Input alternates betweenis first a letter andthen a number.

Example:
Input: z
Press Send
Input 3
Press Send
Outputs: Go Go Go!

Edit:
Saved 9 bytes with input from @Fatalize

Prolog, 371 - 11 = 360 bytes

My first attempt at code golf.
I chose a language which seem to be underrepresented here.
I'm far from an expert at prolog, so this can most likely be improved a lot.
I did not go for any optional bonuses.

    a(z,['MEDIC!','Thanks!','Go Go Go!','Move Up!','Go Left','Go Right','Yes','No']).
    a(x,['Incoming','Spy!','Sentry Ahead!','Teleporter Here','Dispenser Here','Sentry Here','Activate ÜberCharge!','ÜberCharge Ready']).
    a(c,['Help!','For Pony!','Cheers','Jeers','Positive','Negative','Nice Shot','Good Job']).
    r:-repeat,read(X),read(Y),a(X,Z),nth1(Y,Z,A),writeln(A),fail.

##Try it out You can try it out online here.

  1. Create new program
  2. Paste code
  3. As query, just use 'r' without quotes.

Input alternates between letter and number.

Example:
Input: z
Press Send
Input 3
Press Send
Outputs: Go Go Go!

Prolog, 371 362 - 11 = 351 bytes

My first attempt at code golf.
I chose a language which seem to be underrepresented here.
I'm far from an expert at prolog, so this can most likely be improved a lot.
I did not go for any optional bonuses. I tried for the 15% one but it cost me more than I gained.

    a(z,['MEDIC!','Thanks!','Go Go Go!','Move Up!','Go Left','Go Right','Yes','No']).
    a(x,['Incoming','Spy!','Sentry Ahead!','Teleporter Here','Dispenser Here','Sentry Here','Activate ÜberCharge!','ÜberCharge Ready']).
    a(c,['Help!','For Pony!','Cheers','Jeers','Positive','Negative','Nice Shot','Good Job']).
    r:-read(X),read(Y),a(X,Z),nth1(Y,Z,A),write(A),1=2.

##Try it out You can try it out online here.

  1. Create new program
  2. Paste code
  3. As query, just use 'r' without quotes.

Input is first a letter then a number.

Example:
Input: z
Press Send
Input 3
Press Send
Outputs: Go Go Go!

Edit:
Saved 9 bytes with input from @Fatalize

Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

Prolog, 371 - 11 = 360 bytes

My first attempt at code golf.
I chose a language which seem to be underrepresented here.
I'm far from an expert at prolog, so this can most likely be improved a lot.
I did not go for any optional bonuses.

    a(z,['MEDIC!','Thanks!','Go Go Go!','Move Up!','Go Left','Go Right','Yes','No']).
    a(x,['Incoming','Spy!','Sentry Ahead!','Teleporter Here','Dispenser Here','Sentry Here','Activate ÜberCharge!','ÜberCharge Ready']).
    a(c,['Help!','For Pony!','Cheers','Jeers','Positive','Negative','Nice Shot','Good Job']).
    r:-repeat,read(X),read(Y),a(X,Z),nth1(Y,Z,A),writeln(A),fail.

##Try it out You can try it out online here.

  1. Create new program
  2. Paste code
  3. As query, just use 'r' without quotes.

Input alternates between letter and number.

Example:
Input: z
Press Send
Input 3
Press Send
Outputs: Go Go Go!