0

EDIT: I do not want your code! just help me think of a nice way to do it :)

I have a string with 25 characters: ABCDEFGHIKLMNOPQRSTUVWXYZ

and I want to create a matrix5*5 given a position and a direction, position can be one of the corners and direction can be clock or counter clock.

so if I gave this arguments: create((0,0), clock)

I want to recive: ["ABCDE", "QRSTF", "PYZUG", "OXWVH", "NMLKI"]

and I could then print it and recieve:

A B C D E

Q R S T F

P Y Z U G

O X W V H

N M L K I

6
  • 3
    It sounds like you're asking us to write your assignment for you. Might I suggest that people here might be more helpful if you attempted it, posted your code, then asked specific questions about something not working correctly. Commented Dec 4, 2016 at 4:48
  • what is your concern any specific issue? Commented Dec 4, 2016 at 4:49
  • stackoverflow.com/questions/36834505/… and stackoverflow.com/questions/23706690/… can possibly be adapted. There are many more such spiral questions. Commented Dec 4, 2016 at 4:53
  • @Gerrat I have already coded this and it is working but I kinda brute forced it, as i know that the matrix is always 5*5 i have inserted the characters one by one depending on the position and direction. this works for me, but i would like to make this smarter.. I just cant think of anything.. I already tried something with this sequence (5,4,4,3,3,2,2,1,1) wich is the number of inputs to the list every time i change direction, but it is dumb asswel.. Commented Dec 4, 2016 at 4:57
  • @A-B-B thanks! i guess i didnt search enough xD Commented Dec 4, 2016 at 4:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.