Find Jobs
Hire Freelancers

Create Print and Packaging Designs

$10-30 CAD

Terminado
Publicado hace más de 7 años

$10-30 CAD

Pagado a la entrega
you are required to write a program for a logic game called "Weaver's Island". The object of the game is transport "cargo" (Monkeys, Coconuts, and Alligators) from a land port to an island. In order to "transport" the cargo, you will need a "ship" (a character array) that allows you to "transport" only 1 item at a time. MMMM MM / MM M LAND / \ +----------+ CC CCC / C = Coconuts \ | DOCK | C CCCC / M = Monkeys \ +--+-------+ +----+ A = Alligators \ | AAAA AA / \ | AAAAA / +--+-----------+ ~~~~~ ~~ ~~ ~~~~~~~~~~~~~~~~ ~~~~~~ +------+ ~~~ ~~~~~~~ ~~~~~~~~~ | | ~~~~~~ ~~~~~~~~~ ~ | | ~~~~~~~ ~~~ OCEAN ~~ | SHIP | ~~ ~~~ ~~~~ ~~~~~~~~~ ~~~ | | ~~~~~~~~ _/)_ * ~~~ _/)_ * \ / ~~~ ~~~~~~~~~~~ ~~~~~ \ / ~~~ ---- ~~~~~~~~~ ~~~~~~ ~~ ~~~ ~~~~~~~~~ ~~~~~~~~~~~~~~~~ _/)_ * ~~~~~ ~~~~~~ ~~ ~~~ +----------------+ ~~~~~~~ / \ ~~~~~~~ ~~~~~~ / \ ~~ +------+ / ~~~ ~~ / / ~ ~~~ / +------------+ / ~~~~~ + | WEAVER'S | / ~~ ~~~~ OCEAN ~~~~~~ ~ | | ISLAND | / ~~~~~~~~~~~~~~~~~ + +-----+------+ / ~~~~~~~~~~~~~~ ~~ \ | / ~~~ +---------+------------+ ~~~~~~~ ~~~ ~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~ ~~~~~~ OCEAN ~~~~ ~~~~~~~ ~~~~ However, the game has the following rules: 1. Only 1 type of cargo can be transported at a time. 2. The Monkeys cannot be left alone with the Alligators because the Alligators will eat the Monkeys. 3. The Monkeys cannot be left alone with the Coconuts, because the Monkeys will eat the Coconuts. SPECIFICATIONS (REQUIREMENTS): ------------------------------ ----------- In order to complete this assignment, you will be required to complete the code for the following functions that make use of characters strings. Recall: void loadCargo(char ship[ ], char land[ ], char type); void transportCargo(char ship[ ], char destination[ ], int dir); void loadCargo(char ship[ ], char land[ ], char type); For example: char letter1 = 'M'; char letter2; letter2 = letter1 + 32; /* letter2 now contains 'm' */ OUTPUT: #include <stdio.h> #include <string.h> void loadCargo(char ship[ ], char land[ ], char type); void transportCargo(char ship[ ], char destination[ ], int dir); void printRegion(char region[ ], int dir); int main( ) { char land[121] = " CCCCCCCCAAAAAAAAAAAAAAAAAAAAAM MMMM"; char island[121] = ""; char ship[121] = ""; int i; /* YOUR CODE HERE... YOUR CODE HERE... */ printRegion(land, 1); printRegion(island, 0); return 0; } void loadCargo(char ship[ ], char land[ ], char type) { /* YOUR CODE HERE... */ } void transportCargo(char ship[ ], char destination[ ], int dir) { /* YOUR CODE HERE... */ } void printRegion(char region[ ], int dir) { int i; printf("%s: ", dir == 1 ? "LAND" : "ISLAND"); for(i=0; region[i] != '\0'; i++) { printf("%c", region[i]); } printf("\n"); } would display: LAND: ccccccccaaaaaaaaaaaaaaaaaaaaam mmmm ISLAND: mmmmmAAAAAAAAAAAAAAAAAAAAACCCC CCCCMMMMM
ID del proyecto: 11213879

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hello there, I have seen your project's description and I am pretty sure that I can complete this task within the given time frame. I can make Weaver's Island with all your specified requirements. So let's talk about your project. Open chat to discuss it further. Thanks
$30 CAD en 1 día
0,0 (0 comentarios)
0,4
0,4

Sobre este cliente

Bandera de CANADA
NORTH YORK, Canada
5,0
3
Miembro desde ago 5, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos 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)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.