You are on page 1of 7

Articial Intelligence Programming With Ruby

Mark Watson
August 26, 2006

ii

Preface
Why should you consider using Ruby for articial intelligrence programming? I have been programming in various dielects of Lisp for over 20 years and until the last few years Lisp (usually Common Lisp) languages were my rst choice because of the dynamic nature of the Lisp languages and the high runtime performance. Ruby is also an agile dynamic language but lacks the high runtime performance of compiled Lisp.

iii

iv

PREFACE

Chapter 1

Introduction to Ruby for AI Programming


There are many good books and online tutorials on Ruby so this short chapter will concentrate on just what you will need for this book. # e x a m p l e comment x = [ 1 , 2 , 3 , c a t , dog ] x . each { | e l e m e n t | p u t s n e x t e l e m e n t i n a r r a y i s : #{ e l e m e n t } p u t s t e s t s i n g l e q u o t e s t r i n g s f o r n i l do } Produces: next next next next next element element element element element in in in in in array array array array array is is is is is : : : : : 1 2 3 cat dog

Testing.

CHAPTER 1. INTRODUCTION TO RUBY FOR AI PROGRAMMING

Bibliography

You might also like