LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-02-2009, 04:39 PM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
For Fun: Universal AI,Artificial Intelligence, auto-learn, basic version,a daily code


Hello,

While you sleep, one can add some lines to this basic intelligence code.

The basic of this coding is:
- it has to be very basic: A B C D sentences, with A subject and B complement (in right order at beginning)
- it has to be coded in bash or sh
- it can be elaborated, and is capable of learning
The code has to be the simplest as possible, since all is dictionary/database dependent. A can be verb (action / shell), or noun, or subject.
- 2 files only: the main code of the bash program and the database.
- it shall be capable to learn, e.g. type:
Code:
!learn
to add to main dictionary database

Example:
Code:
    George say hello
:> hello
George is e.g. the A.I.

Here is the start:

Code:
echo "Hello"

clear

while [ 1 ] ; do

echo  " "
printf ":> "
read cmd


if [ "" != "$cmd" ] ; then
    
    cat dico.txt | while read ii ; do
	#echo "seen: $ii"
	
	if  [ `echo $ii | cut -f1 -d" "` == `echo $cmd | cut -f1 -d" "`  ] ; then
	    
	    if  [ "n" == `echo $ii | cut -f2 -d" "`  ] ; then
	          echo $ii | cut -f3-25 -d" "
	    fi
	    
	    if  [ "v" == `echo $ii | cut -f2 -d" "`  ] ; then
	          echo "exec..."
	          echo `echo $ii | cut -f3 -d" "` `echo $cmd | cut -f3 -d" "`
	          exec `echo $ii | cut -f3 -d" "` `echo $cmd | cut -f3 -d" "`
	    fi
	    
	fi
	
    done
    

fi




if [ "!learn" == "$cmd" ] ; then
	printf "name:"
	read i
	printf "type, (n for noun and v for action,verb):"
	read j
	if [ "$j" == "v" ] ; then 
	    printf "command:"
	    else
	    printf "word definition:"
	fi
	read k
	echo "$i $j $k" >> dico.txt
fi


if [ "!view" == "$cmd" ] ; then
    cat dico.txt
fi


if [ "!quit" == "$cmd" ] ; then
    exit
    exit 0
fi




done

with dico.txt
Code:
hello n hello
good n positive value
cat n lazy animal of human
dog n animal of human
pc n personal computer
linux n the best operating system
While you sleep, we work on it

Have Fun while coding !! That's the principle& idea !! Not research
Maybe we could have a pseudo - AI, at the end. Never dream, no one will never make it perfect, never, let's stop dreaming. Real A.I. is not possible, will be always bits.

Last edited by frenchn00b; 11-02-2009 at 04:51 PM.
 
Old 11-02-2009, 04:46 PM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
I am not sure I have words to describe my confusion. How are we supposed to work on this in our sleep, exactly?
 
Old 11-02-2009, 04:55 PM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by MS3FGX View Post
I am not sure I have words to describe my confusion. How are we supposed to work on this in our sleep, exactly?
Bash is very basic, everyone almost understands bash, can be even destined to 1-3 weeks new linux users, and can be good start for new linux fans, to get into bash code/commands. Bash can be read easily, and limits the code to the simplest, since it has to be simple to ever have any chances of having any interesting potentials / results.

While you sleep, it is so simple to work with bash, everyone can contribute a piece of code, even an if [ ] ; then ... or a single line costs almost : nothing in time, if 1x line per 100, it becomes fun to see where we end up Ever it has chances or will die, like *nix codes, sometimes.
That's Linux, and will certainly always exists in the future. 100pct new Ubuntu users, each year. It has some good.

~$ apt-get moo
(__)
(oo)
/------\/
/ | ||
* /\---/\
~~ ~~
...."Have you mooed today?"...

Last edited by frenchn00b; 11-02-2009 at 05:00 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there source code for Artificial Intelligence (AI-*Nix-Project) [spykee robot]? frenchn00b Programming 3 11-02-2009 03:23 PM
Artificial Intelligence and Linux, what's up with that ? frenchn00b General 26 03-08-2008 09:37 AM
Linux + Artificial Intelligence AvatarofVirgo Linux - General 4 06-05-2006 07:21 AM
Artificial Intelligence neil Linux - Software 1 06-25-2003 09:57 AM


All times are GMT -5. The time now is 07:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration