Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

small puzzle programming

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53857] small puzzle programming
  • From: zak <chocolatez at gmail.com>
  • Date: Sun, 30 Jan 2005 03:18:21 -0500 (EST)
  • Reply-to: zak <chocolatez at gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

how to code the following puzzle in mathematica programming language:
 the shepherd who want to cross a river aboard a boat taking with him
one of the following items (wolf,sheep,grass) one per time,
 lst ={S,w,g,p}  may describe the group on one side of the river
 lst2={}  may describe the the current state of the other side of the river.
the pairs {{w,p} ,{p,g}} are not allowed
of course the solution is:
((S,p),(S,w),(S,p),(S,g),(S,p))

but how to code this or may be other ideas.

zak


  • Prev by Date: Re: Nonlinear Curve Fitting
  • Next by Date: Simplify problems for checking easy equalities...
  • Previous by thread: why are some functions not listable over packed arrays?
  • Next by thread: Simplify problems for checking easy equalities...