Find Jobs
Hire Freelancers

Write algorithm to calculate shortest path on keyboard

$10-30 USD

Cancelado
Publicado há aproximadamente 10 anos

$10-30 USD

Pago na entrega
This is the on-screen keyboard from one of the video communication devices we use in our office: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 ! @ # $ % ^ & * ( ) ? / | \ + - ` ~ [ ] { } < > SPACE . , ; : ‘ “ _ = BS The on-screen keyboard comes with the following remote control - Image attached and complete document is also reattached: Write an algorithm that calculates: - The most efficient way to enter any given sentence in terms of number of key-strokes on the remote control. Note that there might be more than one way. - The actual sequence of key-presses on the remote control for each solution. The following rules apply: - The initial position of the cursor is at the first character of the sentence that needs to be entered. - Only one cursor key can be pressed on the remote control at the same time. - When the cursor is on the top row and you press cursor-up on the remote control, the cursor will move to the corresponding column on the bottom row. Example: from E to { - The same applies to the most left column, the most right column and the bottom-row when respectively cursor-right, cursor-left and cursor-down are pressed on the remote control. - Special moves: 1 When the cursor is on the space bar and cursor-down is pressed on the remote control, the cursor will move to I (capital i). 2 When the cursor is on the space bar and cursor-up is pressed on the remote control, the cursor will move to #. 3 When the cursor is on I, J, K, L, M, N, O or P and cursor-up is pressed on the remote control, the cursor will move to the space bar. 4 When the cursor is on 8,9, !, @, #, $, % or ^ and cursor-down is pressed, the cursor will move to the space bar. 5 When the cursor is on back space (BS) and cursor-down is pressed on the remote control, the cursor will move to Z. 6 When the cursor is on back space (BS) and cursor-up is pressed on the remote control, the cursor will move to -. 7 When the cursor is on Y or Z and cursor-up is pressed on the remote control, the cursor will move to back space (BS) 8 When the cursor is on + or - and cursor-down is pressed on the remote control, the cursor will move to back space (BS) Coding requirements: • Please code your solution in PHP • Your solution must include unit tests • You do not have to worry about the front-end coding. All we’re interested in is the back-end coding, so it’s perfectly ok to use something like: $sentence = ‘find the optimum path for this sentence’; $keyboard = new Keyboard(); $keyboard->findOptimumPath($s); Only freelancers who can give me a quick turn over of 2 days should apply . Thanks
ID do Projeto: 5692679

Sobre o projeto

Projeto remoto
Ativo há 10 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos

Sobre o cliente

Bandeira do(a) INDIA
Hyderabad, India
5,0
1
Método de pagamento verificado
Membro desde jan. 5, 2014

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.