Вы находитесь на странице: 1из 4

26.05.

2013

PhutballCLIPS/phutball.clp at master WindRaven/PhutballCLIPS GitHub


Search or type a command

This repository

Explore

Features

Enterprise

Blog

Sign up

Sign in

PUBLIC

WindRaven / PhutballCLIPS
Code Network Pull Requests
0

Star

Fork

Issues

Graphs

branch: master

Files

Commits

Branches

Tags

PhutballCLIPS / phutball.clp
WindRaven a year ago Am facut-o de oaie
1 contributor

file

188 lines (179 sloc)

4.577 kb

Edit

Raw

Blame

History

1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8

( d e f f a c t si n i t ( w o nf a l s e ) ( c r n i dn o n e ) ) ( d e f r u l ec u r r e n t i d ( d e c l a r e( s a l i e n c e2 0 0 ) ) ? f< -( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ b a l l? y _ b a l l ) ( m e n$ ? ) ( i d? i d ) ( m o v e s$ ? m o v ) ) ? c< -( c r n i dn o n e ) = > ( a s s e r t( c r n i d? i d ) ) ( r e t r a c t? c ) ( o p e n" n e w d a t a . t x t "m y d a t a" a " ) ( p r i n t o u tm y d a t a" c u r r e n ti d :"? i dc r l f ) ( c l o s e ) ) ( d e f r u l ed e l e t e c u r r e n t i d ? c< -( c r n i d? c i d ) = > ( r e t r a c t? c ) )

( d e f r u l es t r a t e g y ( d e c l a r e( s a l i e n c e1 0 0 ) ) ( t e s t( e q11 ) ) = > ( s e t s t r a t e g yb r e a d t h ) ) ( d e f r u l ew i n p o s i t i o n ( d e c l a r e( s a l i e n c e1 0 ) ) ? f< -( w o r l d ( l i m i t? x _ l i m? y _ l i m );m a xs i z e( o r i z o n t a l a ,v e r t i c a l a ) ( b a l l? x _ b a l l? y _ b a l l );m i n g e ( m e n$ ? );p o z i t i i l eu n ad u p aa l t a ,xy( i d? i d );i d e n t i f i c a t o rp tl u m e ( m o v e so l d? x? y $ ? m o v );l i s t am u t a r i l o r ,i n i t i a lv i d a ) ( t e s t( e q? x _ b a l l( -? x _ l i m1 ) ) ) ? w o n< -( w o nf a l s e ) ? c< -( c r n i d? c i d ) ( t e s t( e q? i d? c i d ) )

https://github.com/WindRaven/PhutballCLIPS/blob/master/phutball.clp

1/4

26.05.2013

4 8 4 9 5 0 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 6 0 6 1 6 2 6 3 6 4 6 5 6 6 6 7 6 8 6 9 7 0 7 1 7 2 7 3 7 4 7 5 7 6 7 7 7 8

( t e s t( e q? i d? c i d ) ) = >

PhutballCLIPS/phutball.clp at master WindRaven/PhutballCLIPS GitHub

( a s s e r t( w i n( i d? i d )( m o v e s$ ? m o v? x _ b a l l? y _ b a l l) ) ) ( a s s e r t( w o nt r u e ) ) ( a s s e r t( c r n i dn o n e ) ) ( o p e n" n e w d a t a . t x t "m y d a t a" a " ) ( p r i n t o u tm y d a t a? i d"w i n p o s i t i o n"c r l f ) ( p r i n t o u tm y d a t a$ ? m o v""? x _ b a l l""? y _ b a l l""-c r l f ) ( c l o s e ) ( r e t r a c t? w o n ) ( r e t r a c t? f ) ( r e t r a c t? c ) ) ; c a n dn us ea f l ao a m e n ii nj u r ,s es t e r gt o a t ef a p t e l ed et i pw o r l d ( d e f r u l en o m e n a r o u n d ( d e c l a r e( s a l i e n c e1 ) ) ? f< -( w o r l d ( l i m i t? x _ l i m? y _ l i m );m a xs i z e( o r i z o n t a l a ,v e r t i c a l a ) ( b a l l? x _ b a l l? y _ b a l l );m i n g e ( m e n$ ? m e n );p o z i t i i l eu n ad u p aa l t a ,xy( i d? i d );i d e n t i f i c a t o rp tl u m e ( m o v e s$ ? m o v );l i s t am u t a r i l o r ,i n i t i a lv i d a ) = > ( o p e n" n e w d a t a . t x t "m y d a t a" a " ) ( p r i n t o u tm y d a t a? i d"n o m e n a r o u n d "c r l f ) ( p r i n t o u tm y d a t a" m e n:"$ ? m e nc r l f ) ( p r i n t o u tm y d a t a" b a l ll o c a t i o n :"? x _ b a l l""? y _ b a l lc r l f ) ( p r i n t o u tm y d a t a" m o v e ss of a r :"$ ? m o v ) ( c l o s e ) ( r e t r a c t? f ) ) ( d e f r u l er e t r a c t w o n ( d e c l a r e( s a l i e n c e0 ) ) ? w o n< -( w o n? b o o l ) = > ( r e t r a c t? w o n ) ) ; c a n da v e mu no mi nj u rs es a r ep ep o z i t i al u i ; r e g u l av a l a b i l ap e n t r up r i m am u t a r e ( d e f r u l em a n a r o u n d ( d e c l a r e( s a l i e n c e7 ) ) ? f< -( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ b a l l? y _ b a l l ) ( m e n$ ? r i g h t? x _ m a n? y _ m a n-$ ? l e f t ) ( i d? i d ) ( m o v e s$ ? m o v ) ) ( t e s t( < =( a b s( -? x _ m a n? x _ b a l l ) )1 ) ) ( t e s t( < =( a b s( -? y _ m a n? y _ b a l l ) )1 ) ) = > ( a s s e r t( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ m a n? y _ m a n );s em i s c al ap o z i t i aj u c a t o r u l u i ( m e n$ ? r i g h t? x _ m a n? y _ m a n-$ ? l e f t ) ( i d? i d ) ( m o v e so l d? x _ b a l l? y _ b a l l $ ? m o v? x _ b a l l? y _ b a l l) ) ) ( a s s e r t( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ b a l l? y _ b a l l);s em i s c al ap o z i t i aj u c a t o r u l u i ( m e n$ ? r i g h t$ ? l e f t? x _ m a n? y _ m a n) ( i d? i d ) ( m o v e s$ ? m o v ) ) ) ( r e t r a c t? f ) ( o p e n" n e w d a t a . t x t "m y d a t a" a " ) ( p r i n t o u tm y d a t a? i d"m a n a r o u n d:t h i sm a n :"? x _ m a n""? y _ m a nc r l f ) ( p r i n t o u tm y d a t a" b a l ll o c a t i o n :"? x _ b a l l""? y _ b a l lc r l f )

https://github.com/WindRaven/PhutballCLIPS/blob/master/phutball.clp

7 9 8 0 8 1 8 2 8 3 8 4 8 5 8 6 8 7 8 8 8 9 9 0 9 1 9 2 9 3 9 4 9 5 9 6 9 7 9 8 9 9 1 0 0 1 0 1 1 0 2 1 0 3 1 0 4 1 0 5 1 0 6 1 0 7 1 0 8 1 0 9 1 1 0 1 1 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8

2/4

26.05.2013
1 1 8 1 1 9 1 2 0 1 2 1 1 2 2 1 2 3 1 2 4 1 2 5 1 2 6 1 2 7 1 2 8 1 2 9 1 3 0 1 3 1 1 3 2 1 3 3 1 3 4 1 3 5 1 3 6 1 3 7 1 3 8 1 3 9 1 4 0 1 4 1 1 4 2 1 4 3 1 4 4 1 4 5 1 4 6 1 4 7 1 4 8 1 4 9 1 5 0 1 5 1 1 5 2 1 5 3 1 5 4 1 5 5 1 5 6 1 5 7 1 5 8 1 5 9 1 6 0 1 6 1 1 6 2 1 6 3 1 6 4 1 6 5 1 6 6 1 6 7 1 6 8 1 6 9 1 7 0 1 7 1 1 7 2 1 7 3 1 7 4 1 7 5 1 7 6 1 7 7 1 7 8 1 7 9 1 8 0 1 8 1 1 8 2 1 8 3 1 8 4 1 8 5 1 8 6

PhutballCLIPS/phutball.clp at master WindRaven/PhutballCLIPS GitHub


( p r i n t o u tm y d a t a" b a l ll o c a t i o n :"? x _ b a l l""? y _ b a l lc r l f ) ( p r i n t o u tm y d a t a" m o v e ss of a r "$ ? m o vc r l f ) ( c l o s e ) ) ; r e g u l av a l a b i l ap e n t r uu r m a t o a r e l em u t a r i ( d e f r u l em a n a r o u n d w i t h o l d l o c ( d e c l a r e( s a l i e n c e8 ) ) ? f< -( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ b a l l? y _ b a l l ) ( m e n$ ? r i g h t? x _ m a n? y _ m a n-$ ? l e f t ) ( i d? i d ) ( m o v e so l d? x _ l a s t? y _ l a s t$ ? m o v ) ) ( t e s t( < =( a b s( -? x _ m a n? x _ b a l l ) )1 ) ) ( t e s t( < =( a b s( -? y _ m a n? y _ b a l l ) )1 ) ) = > ( a s s e r t( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ m a n? y _ m a n );s em i s c al ap o z i t i aj u c a t o r u l u i ( m e n$ ? r i g h t? x _ m a n? y _ m a n-$ ? l e f t ) ( i d? i d ) ( m o v e so l d? x _ b a l l? y _ b a l l $ ? m o v? x _ b a l l? y _ b a l l) ) ) ( a s s e r t( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ b a l l? y _ b a l l );s em i s c al ap o z i t i aj u c a t o r u l u i ( m e n$ ? r i g h t$ ? l e f t ) ( i d? i d ) ( m o v e so l d? x _ l a s t? y _ l a s t $ ? m o v ) ) ) ( r e t r a c t? f ) ( o p e n" n e w d a t a . t x t "m y d a t a" a " ) ( p r i n t o u tm y d a t a? i d"m a n a r o u n dx :"? x _ m a n"y :"? y _ m a nc r l f ) ( p r i n t o u tm y d a t a" m o v e ss of a r "$ ? m o vc r l f ) ( c l o s e ) ) ; c a n dn ea f l a mp eu no mn em u t a mi no g l i n d af a t ad ep o z i t i ap r e c e d e n t a ( d e f r u l eo n a m a n ( d e c l a r e( s a l i e n c e9 ) ) ? f< -( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l? x _ b a l l? y _ b a l l ) ( m e n$ ? r i g h t? x _ m a n? y _ m a n-$ ? l e f t ) ( i d? i d ) ( m o v e so l d? x _ l a s t? y _ l a s t$ ? m o v ) ) ( t e s t( e q? x _ m a n? x _ b a l l ) ) ( t e s t( e q? y _ m a n? y _ b a l l ) ) = > ( a s s e r t( w o r l d ( l i m i t? x _ l i m? y _ l i m ) ( b a l l( +? x _ m a n( -? x _ m a n? x _ l a s t ) ) ( +? y _ m a n( -? y _ m a n? y _ l a s t ) ) ) ( m e n$ ? r i g h t$ ? l e f t ) ( i d? i d ) ( m o v e so l d? x _ b a l l? y _ b a l l$ ? m o v ) ) ) ( r e t r a c t? f ) ( o p e n" n e w d a t a . t x t "m y d a t a" a " ) ( p r i n t o u tm y d a t a? i d"o n a m a nx :"? x _ m a n"y :"? y _ m a nc r l f ) ( p r i n t o u tm y d a t a" o l dp o s :"? x _ l a s t""? y _ l a s tc r l f ) ( p r i n t o u tm y d a t a" n e wp o s :"( +? x _ m a n( -? x _ m a n? x _ l a s t ) ) ( +? y _ m a n( -? y _ m a n? y _ l a s t ) )c r l f ) ( p r i n t o u tm y d a t a" m e n : "$ ? r i g h t""? x _ m a n""? y _ m a n-""$ ? l e f tc r l f ) ( c l o s e )

https://github.com/WindRaven/PhutballCLIPS/blob/master/phutball.clp

3/4

26.05.2013
1 8 7
)

PhutballCLIPS/phutball.clp at master WindRaven/PhutballCLIPS GitHub

GitHub About us Blog Contact & support GitHub Enterprise Site status

Applications GitHub for Mac GitHub for Windows GitHub for Eclipse GitHub mobile apps

Services Gauges: Web analytics Speaker Deck: Presentations Gist: Code snippets Job board

Documentation GitHub Help Developer API GitHub Flavored Markdown GitHub Pages

More Training Students & teachers The Shop Plans & pricing The Octodex

Terms of Service

Privacy

Security

2013 GitHub, Inc. All rights reserved.

https://github.com/WindRaven/PhutballCLIPS/blob/master/phutball.clp

4/4