async function startReg() {

  let lowNum = 1
  let highNum = 100
  let randNum = randomInt(lowNum, highNum)

  console.log("Let's play a game where you (human) make up a number between 1 and 100,\nand I (computer) try to guess it.")

  let secretNumber = await ask("What is your secret number?\nI won't peek, I promise...\n")

  console.log(`Your secret number is: ${secretNumber}\n`)


  let response = await ask("Is your number " + randNum + "? ");
  response = saniLow(response);
  while (response !== "yes" || response !== "y") {
    let lastGuess = randNum
    response = saniLow(response);

    if (response === "yes" || response === "y") {
      
      console.log("VICTORY! YOUR SOUL IS MINE!!!")
      await playAgain()

    } else if (response === "no" || response === "n") {
      response = await ask("Is it higher or lower? ")
      response = saniLow(response)
      if (response === "higher" || response === "h") {
        lowNum = randNum + 1
        randNum = randomInt(lowNum, highNum)
        response = await ask("Is your number " + randNum + "? ")
        if (lastGuess === randNum) {
          console.log("You Cheated! Game Over!")
          playAgain()

        }
      } else if (response === "lower" || response === "l") {
        highNum = randNum - 1
        randNum = randomInt(lowNum, highNum)
        response = await ask("Is your number " + randNum + "? ")
        if (lastGuess === randNum) {
          console.log("You Cheated! Game Over!")
          playAgain()

        }
      }
    }
  }






}
//----------------------------------------- function that starts version where computer guesses -----------------------------------------//
function that starts version where computer guesses
function that starts version where computer guesses
async function startReg() {
  let lowNum = 1
  let highNum = 100
  let randNum = randomInt(lowNum, highNum)
  console.log("Let's play a game where you (human) make up a number between 1 and 100,\nand I (computer) try to guess it.")
  let secretNumber = await ask("What is your secret number?\nI won't peek, I promise...\n")
  console.log(`Your secret number is: ${secretNumber}\n`)
  let response = await ask("Is your number " + randNum + "? ");
  response = saniLow(response);
  while (response !== "yes" || response !== "y") {
    let lastGuess = randNum
    response = saniLow(response);
    if (response === "yes" || response === "y") {
      console.log("VICTORY! YOUR SOUL IS MINE!!!")
      await playAgain()
    } else if (response === "no" || response === "n") {
      response = await ask("Is it higher or lower? ")
      response = saniLow(response)
      if (response === "higher" || response === "h") {
        lowNum = randNum + 1
        randNum = randomInt(lowNum, highNum)
        response = await ask("Is your number " + randNum + "? ")
        if (lastGuess === randNum) {
          console.log("You Cheated! Game Over!")
          playAgain()
        }
      } else if (response === "lower" || response === "l") {
        highNum = randNum - 1
        randNum = randomInt(lowNum, highNum)
        response = await ask("Is your number " + randNum + "? ")
        if (lastGuess === randNum) {
          console.log("You Cheated! Game Over!")
          playAgain()
        }
      }
    }
  }
}
async function startReg ( ) { let lowNum = 1 let highNum = 100 let randNum = randomInt ( lowNum , highNum ) console . log ( "Let's play a game where you (human) make up a number between 1 and 100,\nand I (computer) try to guess it." ) let secretNumber = await ask ( "What is your secret number?\nI won't peek, I promise...\n" ) console . log ( ` ${ secretNumber } \n ` ) let response = await ask ( "Is your number " + randNum + "? " ) ; response = saniLow ( response ) ; while ( response !== "yes" || response !== "y" ) { let lastGuess = randNum response = saniLow ( response ) ; if ( response === "yes" || response === "y" ) { console . log ( "VICTORY! YOUR SOUL IS MINE!!!" ) await playAgain ( ) } else if ( response === "no" || response === "n" ) { response = await ask ( "Is it higher or lower? " ) response = saniLow ( response ) if ( response === "higher" || response === "h" ) { lowNum = randNum + 1 randNum = randomInt ( lowNum , highNum ) response = await ask ( "Is your number " + randNum + "? " ) if ( lastGuess === randNum ) { console . log ( "You Cheated! Game Over!" ) playAgain ( ) } } else if ( response === "lower" || response === "l" ) { highNum = randNum - 1 randNum = randomInt ( lowNum , highNum ) response = await ask ( "Is your number " + randNum + "? " ) if ( lastGuess === randNum ) { console . log ( "You Cheated! Game Over!" ) playAgain ( ) } } } } }
function that starts version where computer guesses
function that starts version where computer guesses