Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ello I really need help MAKE function calledknightsMove, to calculate how many knight's moves it will take to get from two input numbers to two

ello I really need help

  1. MAKE function calledknightsMove, to calculate how many knight's moves it will take to get from two input numbers to two target numbers. A knight's move is one that either adds 2 or subtracts 2 from one number and adds 1 or subtracts 1 from the other number. So if my inputs were:
  2. 1 and 4
  3. and the target was:
  4. 6 and 0
  5. then the moves I could make are:
  6. 1+2 = 3, 4-1=3
  7. 3+1 = 4, 4-2=1
  8. 4+2= 6, 1-1 =0
  9. so the function would return 3, indicating that it would take 3 knight's moves to reach the target. I would also like the function to output the steps it took to reach the goal.

image text in transcribed
\f

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions