Friday, October 24, 2014

Little by Little

I have made very little progress since my last post.  I have spent a lot of my time repairing a computer; all of the programs I previously installed and all the code I had previously written were erased.  Starting back at square one wasn't all bad.  I got to solidify some of the basics and I organized my files and programs a better way the second time around.

Most of my progress in java programming this week came in the form of user input.

System.out.println("Enter your name please.");

String line1 = input.nextLine();

System.out.println("Hello " +  line1 + "! My name is Jarvis.");

System.out.println("What class are you doing this for?");

String line2 = input.nextLine();

System.out.println("Do you love " +  line2 + "?");

String line3 = input.nextLine();

The code above is a simple conversation the user can engage in with the program.  The user enters information in based on a question and that triggers a new line.  In the end, the user would see something similar to

Enter your name please.
Jared
Hello Jared! My name is Jarvis.
What class are you doing this for?
Learning theory
Do you love Learning theory?
Yes

I tried using the "if" java command to make it possible for more that one answer.  For example if I entered "yes" I love learning theory have the program respond with "good", and if I entered "no" have the program respond with "what is the matter with you" but my code had errors and wouldn't run.  I'll keep pluging along... maybe next week.

Learning Theory Application

I was thinking about Artificial Intelligence while I was coding this week.  In media there are so many movies about AI.  As you can see from my Jarvis reference one example for that is the Avengers.  The trailer for Avengers, age of Ultron was released this week.  The main story behind this movie is that Tony Stark makes an AI to protect people, it becomes uncontrollable, and the Avengers have to fight him.

It takes so many lines of code to program a simple fake conversation between my program and its user.  How is AI possible?  Chapter 4 mentions how progress during the last 50 years has been slow with AI.  I can see why.  Java is a production system, it has if/then statements similar to if red, stop; if green, go.  But It would be very difficult to write if/then statements about all aspects of life.



No comments:

Post a Comment