Artificial Intelligence

Artificial intelligence has multiple areas : linguistic, logic-mathematical, musical, spatial, bodily/kinesthetic, interpersonal, intrapersonal, and naturalistic. linguistic = languages, logic-mathematical = problem-solving, musical = rhythm or beat or playing music in general, spatial = identification of the enironment bodily-kinetics: The way your body reacts to the environment, interpersonal = communication between people/objects or social algorithms, intrapersonal = The ability to check ones self: self-awareness: creates own ideas, and naturalistic is the ability to simulate life's qualities.

Alan Turing

Alan Turing was a Pioneering Computer Scientist, Mathmetician, logician, and philosipher. He is also called the father of Artificial Intelligence. He created 'The Turing Test' which was a conversation between a human and a robot to see if the robot/human could simulate 'intelligence'. The person/robot had to be witty, smart, interpersonal, or more in order to be called intelligent. The goal was to see if the robot could fool the interrogator into thinking that the robot was a human.

Alan Turing was not only known for the turing test. He was also know for breaking codes and creating the enigma machine. Alan was a cryptician. This means he created codes that held secret messages and decoded codes. He led Hut 8: A team that was meant to break german naval codes.In order to revolutionize the process of breaking codes, he decoded the enigma machine which scrambled messages and decoded messages just as efficiently that was on the german side.

Passed the Turing Test

the script below shows a chat bot I made in python that passed a turing test through sheer stupidity. At first, An elif statement kept redirecting my answers to a default ELSE statement which made the program say the same thing over and over. And then, Since my bot could do math questions, someone got smart and said "h0w are y0u d0ing" Which caused my program to stop and have a syntax error because it tried to do math with letters, but the people still thought that my bot was human WHICH WAS SOOOO FUNNY!

Read the commented code to understand

This script below shows how I made a computer bot in python that trys to battle you, the player, in a wonderful world wide known game of ... Wait for it!... Rock Paper Scissors. I did this in javascript as well for a little interactivity.

Rock, Paper, scissors game:

Guess my number game: Making this game was easy in terms of algorithmic thinking but making it programmatically took a little bit more effort to make because we needed the conditionals to tell the person if they were getting hotter or colder to the answer. The code is here in the following:

function interactive_guess_my_number(){
 alert("Pick a number from 1-100 in the next window to play guess my number.");
 var computerChoice = parseInt(Math.random() * 100);    //random number
 while (true){
 var guess = prompt("Hello, this is guess my number. Please pick a number between 1 and 100").split(/[\(\)\[\]\.]/).join("");
 if (parseInt(guess) === computerChoice){  //CORRECT ANSWER
  alert("Winner :" + " " + guess + " Was correct");
  break;
 } if (parseInt(guess) > computerChoice){  // TOO HIGH
  alert(guess + " is too high");
 } if (parseInt(guess) < computerChoice){  // TOO LOW
  alert(guess + " is too low")
 }
}
}

hangman game: Making this game was not that hard in general. But, making animations(below) was harder because my processes stopped the drawing when I actually wanted it to happen in real time. This game features an AI that chooses a random word from the game and makes you guess the word.

var tried = 0; function setup() {
 createCanvas(400, 400);
}
function hangman(){
 var tries = 0;
 var word = words[Math.floor(Math.random() * words.length)];//pick a random word
 alert("I am thinking of a word that is " + word.length + " characters long.");
 alert("You have 5 seconds to move to the bottom of the page");
 window.setTimeout(function(){//wait for user to go to the bottom
 var cguesses = "";//correct guesses
 var guesses = ""//guesses
 var seq = [make_lazy(ellipse,200,150,50,50),make_lazy(line,200,150,200,250),make_lazy(line,150,200,200,200),make_lazy(line,250,200,200,200),make_lazy(line,200,250,250,300),make_lazy(line,200,250,150,300) ];  //commands to draw the stickman
 while (tries < 7){  //loop 7 times
 var humanchoice = prompt("choose one letter from a-z").toLowerCase();   // take in user input
 if (/[\d\(\)\[\]]/.test(humanchoice) || humanchoice.length !== 1){   //
  alert("NO NUMBERS OR WEIRD CHARACTERS PLEASE AND ONLY \"ONE\" CHARACTER AT A TIME PLEASE.");
  humanchoice.split(/[\d\(\)\[\]]/);  //destroy all the wrong and weird characters
  humanchoice.splice(1,humanchoice.length-1);  //destroy whitespace
  }
 if (word.inString(humanchoice)){//checks if the person's choice is in the word
   cguesses += humanchoice;//correct guesses increment by one
   alert(humanchoice + " is in the word I am thinking of");
 } if (!word.inString(humanchoice)){
   seq[tries]();  //excecutes closures in the commands in seq
   tries += 1;
   alert(humanchoice + " is not in the word I am thinking of");
 }
 guesses += humanchoice;
 for (var i = 0; i < word.length;i++){
   if (!(cguesses.inString(word[i]))){
   break;
   } if (i === word.length-1){
   alert("Great JOB the word was : " + word);
   return;
   }
 }
 alert("You have guessed :\n" + guesses.split("").join(" ") );
 alert("Your correct guesses are :\n" +cguesses.split("").join(" "));
 tried += 1;
 }
  },4000);
}

Tic Tac ToeTicTacToe

Press the buttons for interactive games

Congrats Watson!

Watson, IBM's jeopardy winning Machine AI. It is a learning machine that sports a database with ALL of jeopardy's old questions and about 10% of the internet at most. It won against old jeopardy winners and 74 time winning champion Ken Jennings and Dave by one question. Before this feat happened, The team that build this had to go through multiple barriers like language, slang, jokes, context clues, gender. It did well in factual questions because all it had to do was find it in the database.

War Games!

War games is a movie about when a military AI called WOPR becomes rogue and starts a simulation that fools the U.S. into thinking they were getting attacked by the Russians. The movie focuses on a hacker called steven. He is the one who made the WOPR become rogue. He is also the one who disarms it by making it learn that there was a point to give up. When there is no winner. In tic tac to, if you make "every" move "perfect and calculated" there will be no winner with the help of the creator of WOPR.