6 kyu

Game Hit the target - 2nd part

208 of 449Ruscore

Description:

Hit the target

This is the second part of the kata :3 šŸŽˆšŸŽ†šŸŽ‡šŸŽ†šŸŽˆ
given a matrix n x n (2-7), determine if the arrow is directed to the target (x).
Now there are one of 4 types of arrows ( '^', '>', 'v', '<' ) and only one target (x)
An empty spot will be denoted by a space " ", the target with a cross "x", and the scope ">"

Examples:

given matrix 4x4:
[
[' ', 'x', ' ', ' '],
[' ', ' ', ' ', ' '], --> return true
[' ', '^', ' ', ' '],
[' ', ' ', ' ', ' ']
]

given matrix 4x4:
[
[' ', ' ', ' ', ' '],
[' ', 'v', ' ', ' '], --> return false
[' ', ' ', ' ', 'x'],
[' ', ' ', ' ', ' ']
]

given matrix 4x4:
[
[' ', ' ', ' ', ' '],
['>', ' ', ' ', 'x'], --> return true
[' ', '', ' ', ' '],
[' ', ' ', ' ', ' ']
]

In this example, only a 4x4 matrix was used, the problem will have matrices of dimensions from 2 to 7
And here is the first part of this kata - click me ā—vā—
Happy hacking as they say! šŸ’»

Matrix
Arrays
Strings
Fundamentals

More By Author:

Check out these other kata created by Ruscore

Stats:

CreatedOct 26, 2021
PublishedOct 26, 2021
Warriors Trained802
Total Skips23
Total Code Submissions2272
Total Times Completed449
JavaScript Completions208
Python Completions221
Rust Completions33
Go Completions17
Total Stars20
% of votes with a positive feedback rating92% of 120
Total "Very Satisfied" Votes103
Total "Somewhat Satisfied" Votes15
Total "Not Satisfied" Votes2
Total Rank Assessments21
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Ruscore Avatar
  • JohanWiltink Avatar
  • monadius Avatar
  • akar-0 Avatar
Ad