Skip to content

A simple chat bot to teach about web-sockets, web-servers and the difficulties to create a meaning-full conversation.

License

Notifications You must be signed in to change notification settings

f0bs/IDD-Fa19-Lab6

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatBot

A lab report by Fabio Daiber

In this Report

To submit your lab, fork this repository. You'll need to upload any code you change into your fork, as well as upload a video of a friend or classmate using your chatbot.

Make the ChatBot your own

Here's my uploaded file: chatServer.js

I've created a vacay recommendation bot. I've used the template from David and set up my own questions. I ask a bunch of preference question such as resort vs. non-resort, beach vs. mountain, etc. Every question has a counter chosen based on the response to determine a good vacation option:

      answer = 'Perfect!';
      chosen = 1; // go far
    } else {
      answer = 'Oh, too bad. I still got you!';
      chosen = 0; // go not far
      }

After all question have been answered, I show the best destination according to the answers on the previous questions:

if (chosen == 0) {
    answer = 'Ok here\'s what I have found: \n The Blue Ridge Mountains! It\'s close, lot\'s of small cabins and great mountains for hiking.'; // not far, no resort, no beach
} else if (chosen == 1) {
      answer = 'Ok here\'s what I have found: \n The Rockies! It\'s far from your place, lot\'s of small cabins and great mountains for hiking.'; // far, no resort, no beach
} else if (chosen == 10) {
      answer = 'Ok here\'s what I have found: \n Mohonk Mountain Resort! It\'s not far from your place, has a great resort with spa and everything and great mountains for hiking.'; // not far, resort, no beach
} else if (chosen == 100) {
      answer = 'Ok here\'s what I have found: \n Asbury Park! It\'s not far from your place, has small B&B\'s and a nice beach.'; // not far, no resort, beach
} else if (chosen == 110) {
      answer = 'Ok here\'s what I have found: \n Hilton Head! It\'s not far from your place, has great resorts and a nice beach.'; // not far, resort, beach
} else if (chosen == 111) {
      answer = 'Ok here\'s what I have found: \n Bali! It\'s far from your place, has wonderful resorts and the best beaches.'; // far, resort, beach
} else if (chosen == 11) {
      answer = 'Ok here\'s what I have found: \n St. Moritz, Switzerland! It\'s far from your place, has wonderful resorts and great mountains.'; // far, resort, no beach
} else if (chosen == 101) {
      answer = 'Ok here\'s what I have found: \n Tulum, Mexico! It\'s far from your place, has small B&B\'s and a nice beach.'; // far, no resort, beach
}

Record someone trying out your ChatBot

Here's my video: Bil trying my bot


Starter code by David Goedicke, closely based on work by Nikolas Martelaro and Captain Anonymous, who forked original work by Ian Tairea.

About

A simple chat bot to teach about web-sockets, web-servers and the difficulties to create a meaning-full conversation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 88.3%
  • HTML 6.3%
  • CSS 5.4%