Step 7 Dec 2010 Puzzle

L D[AR2P#0.0]

Lifetime Supporting Member
Join Date
Nov 2006
Location
UK
Posts
6,693
Four rabbits start at the four corners of a 32x32m field. A farmer fires his gun and each rabbit starts running in an anti-clockwise direction and chases after the rabbit in the next corner. Eventually the rabbits end up in a flurry in the middle of the field.

Using PLCSIM, write a program that shows the trajectory of the rabbits from the starting gun using the Q outputs arranged as below. The rabbits are shown in their starting positions.

Supplementary question - How for does each rabbit travel before they meet in the middle of the field?

Seasons greetings to all.

rabits1.jpg
 
Last edited:
Hi,
should the rabbits be able to do diagonal steps, or only one step in x or y direction like the tower in chess?
 
Which rabbit did the farmer shoot?

Where I come from, he wouldn't have missed, so he's a dead 'un, and the one to his clockwise (rabbit_2) wouldn't have anything to chase, so he'd sit there doing sweet f.a. He realises there's no point running after a dead rabbit! He can be considered lazy, or clever.

That means his "chaser", rabbit_3, would run straight at him, along the side of the square, to the next CCW corner.

Rabbit no.4 therefore chases him to the same corner, and will take a diagonal run to meet him where he intercepts with lazy/clever rabbit.

I can't see how they meet in the middle to enjoy their MacDonalds Ice-Cream.

But it don't matter, because the farmer has had ample time to reload, and with suitable Buck-Shot, can take the other 3 rabbits out with one more shot after they have converged at said corner.

Put a big pot on the stove - rabbit stew for tea I think !!
 
Rabbit no.4 therefore chases him to the same corner, and will take a diagonal run to meet him where he intercepts with lazy/clever rabbit.

Even if rabbit 1 is dead, rabbit 4 wouldn't run in a straight line towards rabbit 2, he'd start off running straight towards rabbit 3, but rabbit 3's position is changing, so rabbit 4's path is kind of "curving" towards the stationary rabbit 2.

I wish I had enough time to play with the math to find their paths... I'm sure there is a way to make an equation to find their positions.
 
The farmer is a clever one.
First he shots in the air and the rabbits are running around until they meet around the middle - where he does all of them with one single shot...

I think he has to wait 30 steps before they meet in the middle.
"Bresenham line algorithm" is a good starting point for programming this.
 
You have a flaw in your algorithm or your plotting logic.

Here's a simple example solution I found using bugs instead of rabbits:

bugs.JPG
 
I'm already curious about your "rabbit logic".
My rabbits are pretty dumb. On each iteration they check which axis (x or y) to the next rabbit is the nearer one, and do one step in the resulting direction, or a diagonal step when near enough.
It's fast, but it's not drawing nice lines...🍻
 

Similar Topics

I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
170
Good Morning, Hoping someone with some Siemens experience can give me a hand with this one. Customer has a S7-200 cpu, which has a 6GK7...
Replies
0
Views
244
HI! HOW COULD I OBTAIN THE NAMES OF THE STEPS OF A ROUTINE IN SFC LANGUAGE IN STUDIO5000? Or is there a system variable that gives me those...
Replies
0
Views
339
I'm just trying to figure out the right method of adding a DO card to an existing rack. It's not the *next* open slot, but I have to move the AO...
Replies
5
Views
545
Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
664
Back
Top Bottom