Manipulating strings using
Human Level
Artificial Intelligence
Note: To make this website free to the public
please click on an ad to support my sponsors or you
can make a tax-deductable donation using Paypal
(click on the donation icon on the left).
This video shows a robot
writing a simple software program to manipulate
strings.
Something as simple
as manipulating strings require lots of intelligence.
First of all, in order to use strings in C++, you
have to include a file in your program. Next, you
must take the knowledge you learned from school about
string manipulation and apply them to your
assignment. If the assignment wants the robot to
concatenate two strings, he has to know what the
language structure for C++ looks like. Concatenating
strings and facts on string data types are different
for every programming language.
Also, writing codes
to read in text from a user requires knowledge as
well. The robot knows that a first name can have one
or more words. This fact tells the robot he can't use
cin to read in text. Instead, there is a built-in
function called getline() in C++ that can retrieve
entire words in a line and store it in a string
variable.
This video shows how
a robot thinks while writing a simple string
manipulation program.