|
5个flash的游戏地址是
![]() /*
四个字段分别代表 羊,狼,草,人的位置,0表示河左边,1表示河右边。 每次都必须有人过河,因为动物和植物们都不会划船。 */ declare @t table (y bit , l bit , c bit , r bit , path varchar (8000 )) insert into @t select 0 , 0 , 0 , 0 , '' ;with t as ( select * , 0 as cc from @t union all select ~ y , l , c , ~ r , path + '人羊' + ltrim (r )+ '→' , cc + 1 from t where cc < 10 and y = r and y & l & c = 0 and path not like '%人羊_→' union all select y , ~ l , c , ~ r , path + '人狼' + ltrim (r )+ '→' , cc + 1 from t where cc < 10 and l = r and y & l & c = 0 and y <> c and path not like '%人狼_→' union all select y , l , ~ c , ~ r , path + '人草' + ltrim (r )+ '→' , cc + 1 from t where cc < 10 and c = r and y & l & c = 0 and y <> l and path not like '%人草_→' union all select y , l , c , ~ r , path + '人' + ltrim (r )+ '→' , cc + 1 from t where cc < 10 and y & l & c = 0 and y <> c and y <> l and path not like '%人_→' ) select REPLACE (REPLACE (path , '0' , '过河' ), '1' , '返回' ) as path from t where y & l & c = 1 /* 人羊过河→人返回→人草过河→人羊返回→人狼过河→人返回→人羊过河→ 人羊过河→人返回→人狼过河→人羊返回→人草过河→人返回→人羊过河→ */
![]() (责任编辑:admin) |

