Question: : - dynamic used / 1 . / * Flower garden 1 D V 4 Rules: 1 ) The garden consists of 1 row, each
: dynamic used
Flower garden D V
Rules:
The garden consists of row, each with N plantings N is at least One flower species occupies each planting. The Row is horizontally laid out with plantings from at the left to N at the right. You will use a Prolog list to represent the row.
Flowers have Name, Size, WetDry Color.
A given flower species can only be used once per row.
No two adjacent plantings can have the same color flower.
No two adjacent plantings can have flowers whose size is more than one size difference. Sizes are small, med, tall so small next to small is fine, small next to medium is fine, but small next to tall is not.
The two outermost plantings and N are dry, the two innermost are wet, the ones in between if there are any can take either.
flowerName Size, WetDry, Color
flowerdaisies med, wet, yellow
flowerroses med, dry, red
flowerpetunias med, wet, pink
flowerdaffodils med, wet, yellow
flowerbegonias tall, wet, white
flowersnapdragons tall, dry, red
flowermarigolds short, wet, yellow
flowergardenias med, wet, red
flowergladiolas tall, wet, red
flowerbirdofparadise, tall, wet, white
flowerlilies short, dry, white
flowerazalea med, dry, pink
flowerbuttercup short, dry, yellow
flowerpoppy med, dry, red
flowercrocus med, dry, orange
flowercarnation med, wet, white
flowertulip short, wet, red
flowerorchid short, wet, white
flowerchrysanthemum tall, dry, pink
flowerdahlia med, wet, purple
flowergeranium short, dry, red
flowerlavender short, dry, purple
floweriris tall, dry, purple
flowerpeonies short, dry, pink
flowerperiwinkle med, wet, purple
flowersunflower tall, dry, yellow
flowerviolet short, dry, purple
flowerzinnia short, wet, yellow
plantassignN List
uniquecheckList
uniquecheck
uniquecheck
uniquecheckFlower FlowerT :
memberFlower T
uniquecheckFlowerT
colorcheckList
colorcheck
colorcheck
colorcheckFlower FlowerT :
samecoloradjacentFlower Flower
colorcheckFlowerT
samecoloradjacentFlower Flower :
flowerFlower Color
flowerFlower Color
Color Color
sizecheckList
sizecheck
sizecheck
sizecheckFlower FlowerT :
incompatiblesizesadjacentFlower Flower
sizecheckFlowerT
incompatiblesizesadjacentFlower Flower :
flowerFlower Size
flowerFlower Size
incompatiblesizesSize Size
incompatiblesizessmall tall
incompatiblesizesmed tall
incompatiblesizestall
wetcheckList
wetcheck
wetcheck
wetcheckFlowerRow :
flowerFlower WetDry,
WetDry wet,
wetcheckRow
writegardenList
writegarden
writegardenFlowerRest :
writeFlower nl
writegardenRest
gardenplanN
gardenplanN :
retractallused
plantassignN List
uniquecheckList
colorcheckList
sizecheckList
wetcheckList
writegardenList
DO NOT PUT THIS INTO CHAT GPT
Please provide me the solution for plantassign.
THIS IS IN PROLOG
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
