• As @fanoush says you can move the console elsewhere. Maybe try something like:

    function ask(text, callback) {
      Bluetooth.on('data',function(d) {
    function go() {
      // Move console out the way
      ask("A, B or C?", function(d) {
        Bluetooth.println("You picked "+JSON.stringify(d));
        ask("1, 2 or 3?", function(d) {
          Bluetooth.println("You picked "+JSON.stringify(d));
          /* Move the console back so you
          can interact with the REPL again. If you don't
          you'll have to disconnect and reconnect via
          Bluetooth to get it back */

    Note that while the console is out the way, print/etc won't work either and you can't interact with the REPL.

    As @allObjects says, having A() etc is super easy to do though.

    Another option based on that is to use 'getters' that got introduced in new Espruino 2v00ish, which will work in a similar way, but without you needing the brackets:

    >Object.defineProperty(global,"a",{get:(­)=>print("you picked 'a'")})
    you picked 'a'

Avatar for Gordon @Gordon started