Skip to main content

Dart. 802b

Live Online App (press play)

http://try.dartlang.org/s/9mJD

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings (4 in the super optimized version), each char is an ascii lookup in the list.
  3. The final string injects the first two at various points, using string interpolation.
  4. The final string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i) => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}

Minimized Version

https://gist.github.com/2854180

Dart. 802b

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings (4 in the super optimized version), each char is an ascii lookup in the list.
  3. The final string injects the first two at various points, using string interpolation.
  4. The final string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i) => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}

Minimized Version

https://gist.github.com/2854180

Dart. 802b

Live Online App (press play)

http://try.dartlang.org/s/9mJD

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings (4 in the super optimized version), each char is an ascii lookup in the list.
  3. The final string injects the first two at various points, using string interpolation.
  4. The final string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i) => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}

Minimized Version

https://gist.github.com/2854180

Dart. 802b

Minimized version: https://gist.github.com/2854180

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings (4 in the super optimized version), each char is an ascii lookup in the list.
  3. The thirdfinal string injects the first two at various points, using string interpolation.
  4. The thirdfinal string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i) => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}

Minimized Version

https://gist.github.com/2854180

Dart. 802b

Minimized version: https://gist.github.com/2854180

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings, each char is an ascii lookup in the list.
  3. The third string injects the first two at various points, using string interpolation.
  4. The third string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i) => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}

Dart. 802b

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings (4 in the super optimized version), each char is an ascii lookup in the list.
  3. The final string injects the first two at various points, using string interpolation.
  4. The final string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i) => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}

Minimized Version

https://gist.github.com/2854180

Added some better formatting and a short explanation of my approach
Source Link
John
  • 21
  • 2

Dart. 819b on the first pass

Dart. 802b

Minimized version: https://gist.github.com/2854180

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings, each char is an ascii lookup in the list.
  3. The third string injects the first two at various points, using string interpolation.
  4. The third string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i)=>o+=i==126 => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}

Dart. 819b on the first pass

https://gist.github.com/2854180

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i)=>o+=i==126?'\n':'${x[i-32]} ');
  print(o);
}

Dart. 802b

Minimized version: https://gist.github.com/2854180

My approach

Uses no compression libraries.

  1. The starting string is the lyrics with all duplicate words removed, then split by ' ' into a list.
  2. I create 3 strings, each char is an ascii lookup in the list.
  3. The third string injects the first two at various points, using string interpolation.
  4. The third string is converted into char codes and used to perform the look ups in the word list.

Verbose Code

void main() {
  var x="We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of wouldn't get this from any other guy just wanna tell you how feeling Gotta make understand Never gonna give up let down run around desert cry say goodbye a lie hurt We've known each for long Your heart's been aching but You're too shy it Inside we both what's going on We game we're play And if ask me Don't you're blind see (Ooh, up) (Ooh) give, never (Give".split(' ');
  var c="DEF>G~DEH>I~DEJK)L>~DEB>M~DENO~DE=PQ)R>~~";
  var d="STU9V*W~XYZ[\\~]^_#N`~abc&dZef~g&'h)iEj`~";
  var a=' !"#\$~%&\'()*+,~-./0123~%456789:~,;<=>?1@~AB>C~~$c${d}kl>mn?1@~o=np^q#r~~$c${c}sF>t~sF>t~u~DEvDEF~x>t~u~DEvDEF~x>t~~$d~,;<=>?1@~AB>C~~$c$c$c';
  var o='';
  a.charCodes().forEach((i) => o += i == 126 ? '\n' : '${x[i-32]} ');
  print(o);
}
embedded source
Source Link
John
  • 21
  • 2
Loading
Source Link
John
  • 21
  • 2
Loading