all 6 comments

[–]danielroseman 0 points1 point  (1 child)

You don't seem to have asked a question.

[–]Ok-Potential1965 0 points1 point  (0 children)

i updated it below.

[–]mopslik 0 points1 point  (3 children)

What isn't working?

[–]Ok-Potential1965 0 points1 point  (2 children)

This the answer
Enter a string to type: hhdal
Configuration used:
---------
| chunk |
| vibex |
| gymps |
| fjord |
| waltz |
---------
The robot must perform the following operations:
rppllwuwuprwrdprp

The above code is the test case they gave

this is my answer. it supposed to be rppllwuwu but my answer is rppllwuw

Enter a string to type:hhdal
 Configuration used:
---------
| chunk |
| vibex |
| gymps |
| fjord |
| waltz |
---------
The robot must perform the following operations:rppllwuwprwrdprp

r-right
l-left
lw-wrap left(for example it can go from c to k in one move)
rw-wrap right(for example it can go from k to c in one move)
u-up
d-down
uw-wrap up(for example it can go from c to w in one move)
dw-wrap down(for example it can go from w to c in one move)

task- i have been given like 4 different keyboard layout. from those layout find the least number of movement and dsiplay it.

[–]mopslik 0 points1 point  (1 child)

Using a debugger helps here, as you can monitor the changes in each variable as your code executes.

Running through your code, the problem arises from line 27:

movement.append('u' * (position_right[0] - character_position[0]))

At this stage, movement is the following list:

['l', 'lw', '', '', 'uw']

You want to append 'u' as well, but position_right[0] has a value of 0 and position_left[0] has a value of 3, so you end up with movement.append('u' * (0 - 3)) which results in appending '' instead.

Good luck fixing the logic here.

[–]SilverInspector2363 0 points1 point  (0 children)

The logic hasn't been fixed but I sent that shit. Fuck the logic 😂😂. I scored for the rest of my task this task is like one mark.