changeset 4066:ae35f09dbbcb

<mrhmouse> fetch http://pastebin.com/raw.php?i=HTSNtgqS
author HackBot
date Fri, 22 Nov 2013 16:10:23 +0000
parents 6141355f1222
children 4525db6837db
files raw.php?i=HTSNtgqS
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/raw.php?i=HTSNtgqS	Fri Nov 22 16:10:23 2013 +0000
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+(function() {
+  var consonant_then_o, ends_with_consonant, ends_with_e, name, starts_with_o;
+
+  name = process.argv[2];
+
+  if (!(name != null ? name.length : void 0)) {
+    console.log('Usage: ello <name>');
+    process.exit();
+  }
+
+  ends_with_e = /(.*)(e)$/i;
+
+  consonant_then_o = /(.*)([bcdfghjklmnpqrstvwxz])([o0].*)/i;
+
+  ends_with_consonant = /[bcdfghjklmnpqrstvwxz]$/i;
+
+  starts_with_o = /[o0]/i;
+
+  console.log(consonant_then_o.test(name) ? name.replace(consonant_then_o, function(match, before, consonant, rest) {
+    return before + consonant + 'ell' + rest;
+  }) : starts_with_o.test(name) ? 'hell' + name : ends_with_e.test(name) ? name.replace(ends_with_e, function(match, before) {
+    return before + 'ello';
+  }) : ends_with_consonant.test(name) ? name + 'ello' : "Hello, " + name + "!");
+
+}).call(this);
\ No newline at end of file