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

xicocana
  • 115
  • 2
  • 9
  • 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. – Gerrat Dec 04 '16 at 04:48
  • what is your concern any specific issue? – Alg_D Dec 04 '16 at 04:49
  • https://stackoverflow.com/questions/36834505/creating-a-spiral-array-in-python and https://stackoverflow.com/questions/23706690/how-do-i-make-make-spiral-in-python can possibly be adapted. There are many more such spiral questions. – Asclepius Dec 04 '16 at 04: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.. – xicocana Dec 04 '16 at 04:57
  • @A-B-B thanks! i guess i didnt search enough xD – xicocana Dec 04 '16 at 04:59
  • If you figured out (5,4,4,3,3,2,2,1,1), then you should see a pattern ;) – Imperishable Night Nov 04 '17 at 19:46

0 Answers0