1001 Freelance Projects
Latest Projects from Freelance Marketplaces
Today is: 18-May-2024 05:37 GMT
View Project
View this project in detail (Note: you will be redirected to external marketplace)
Project title: C++ Programmer needed
Posted by: External project from PeoplePerHour
Started: 20-Nov-2020 11:42 GMT
Description: Expected duration: 1 - 2 weeks
Your task is to implement a robot war, in which a large number of robots, grouped into several teams, move around in 2-dimensional space.

Your program will read as input two files, start.txt and commands.txt, and produce output on the standard output.

The format of these files is described below, but you should create your own for testing purposes.

Your submissions will be run against several different input combinations.

The initial state of the system is described by a file start.txt, each line of which will contain four numbers identifying a robot, its team, and its initial position, e.g. \begin{verbatim} 1673 2 53 -89 \end{verbatim}

This says that robot 1673 belongs to team 2 and starts with x-coordinate 53 and y-coordinate -89.

Robots and teams are identified by positive whole numbers; coordinates are also whole numbers but may be negative.

You may assume that each robot is specified only once, and that each robot starts out in a different position. At any time, each robot will be facing north, east, south or west.

All robots start off facing north.

We assume a conventional 2-dimensional space, so one step north from (53, -89) is (53, -88), while one step east would be (54, -89).

The program should then read commands.txt, acting on each line as it is read.

The lines have the following forms and meanings, where r stands for a robot number.
If the named robot does not exist, the command should be silently ignored.
 show

The program should print to the standard output the current positions of all the robots still in the system, in the same format as start.txt above, but in ascending order of robot number. travelled

List all the robots in the system, each with the total distance it has travelled.
For example, if a robot has moved north 3 steps, east 1 step, and then south 2 steps, it has moved a total of 6 steps, even though it is only 2 positions from where it started.

Each line of the output should consist of two numbers, the robot number and the distance travelled, and they should be in increasing order of distance travelled.
If two robots have travelled the same distance, order them by robot number.
within n

Print out the number of robots within n steps of the origin. (That is, the distance is n or less.) You should print the number on a line by itself, with no extra text.

Distance here is the sum of the absolute values of the x- and y-coordinates (the Manhattan metric), so the distance to (2, -5) is 7.
 turnleft r

Make robot r turn to the left, e.g. if it is facing north, turn it to face west.
 turnright r

Make robot r turn to the right, e.g. if it is facing north, turn it to face east.
move r

Attempt to move robot r one step in the direction it is facing.

If the target location is already occupied by a robot on the same team, no move is possible, and the robot stays where it was. If the target location is occupied by a robot of another team, that robot should be removed from the system, after which our robot moves.

You may assume that both files are correctly formatted: there is no need for your program to check for incorrect input.

Your program should not produce any other output than the above.
If you add extra output statements during testing, be sure to remove them before submission.
If you have added a pause before the program exits, please remove that too.
(A better approach would be to configure your IDE to automatically pause so you don't need it in your program.)
Project ID: 3108969
Project category:
Project budget:
View this project in detail (Note: you will be redirected to external marketplace)
Last Projects / Browse Projects
  Project Started
CAD Designer for Comprehensive Machine Design -- 2
Category: 3D Modelling, CAD / CAM, Manufacturing Design, Product Design, Solidworks
Budget: ₹1500 - ₹12500 INR
18-May-2024
04:04 GMT
Literary Fiction Short Story Editing
Category: Creative Writing, Editing, Fiction, Poetry, Proofreading
Budget: $10 - $30 USD
18-May-2024
04:04 GMT
PC Action Game Testing -- 2
Category: Software Testing, Test Automation, Testing / QA, Usability Testing, Website Testing
Budget: $10 - $30 USD
18-May-2024
04:04 GMT
Social Media Intern Required
Category: BPO, Data Entry, Excel, Facebook Marketing, Social Media Marketing
Budget: ₹100 - ₹400 INR
18-May-2024
04:04 GMT
Desarrollador Odoo Experto -- 2
Category: Django, ERP, Odoo, PostgreSQL, Python
Budget: $2 - $8 USD
18-May-2024
04:04 GMT
Advanced AR Headset Development
Category: Android, Game Development, IPhone, Matlab And Mathematica, Mobile App Development
Budget: ₹500000 - ₹1000000 INR
18-May-2024
04:03 GMT
WooCommerce eCommerce Site with Custom Design (FLS Project)
Category: ECommerce, HTML, PHP, Web Design, WordPress
Budget: $30 - $250 SGD
18-May-2024
04:01 GMT
Promotional Videography for Music Fans
Category: Audio Services, Cinematography, Editing, Lighting, Video Services
Budget: $30 - $250 USD
18-May-2024
04:00 GMT
Loan Processing Optimization for DSCR
Category: Accounting, Business Analysis, Business Plans, Finance, Research Writing
Budget: $2 - $8 USD
18-May-2024
03:59 GMT
3D visualization of the fair
Category: 3D Animation, 3D Modelling, 3D Rendering, 3ds Max, AutoCAD
Budget: €30 - €250 EUR
18-May-2024
03:58 GMT
Wix Website Content & Functionality Upgrade
Category: BigCommerce, HTML, PHP, Web Design, Wix
Budget: $250 - $750 CAD
18-May-2024
03:57 GMT
Urgent UI Design for Landing Page -- 2
Category: Graphic Design, HTML, PHP, User Interface / IA, Web Design
Budget: $10 - $30 AUD
18-May-2024
03:55 GMT
Retail Market Research Specialist in Mexico
Category: Business Analysis, Internet Marketing, Market Research, Marketing, Research
Budget: $30 - $250 USD
18-May-2024
03:54 GMT
Logo Design for Qur'an YouTube Channel
Category: Banner Design, Graphic Design, Illustration, Logo Design, Photoshop
Budget: $30 - $250 USD
18-May-2024
03:52 GMT
TradingView Pine Script Analyst Needed -- 3
Category: Metatrader, Pine Script, Trading
Budget: $10 - $30 USD
18-May-2024
03:52 GMT
Browse All Projects
Projects by Skills ...
Projects for 'android'
Projects for 'ajax'
Projects for 'asp'
Projects for 'aspnet'
Projects for 'cms'
Projects for 'cpp'
Projects for 'csharp'
Projects for 'css'
Projects for 'delphi'
Projects for 'design'
Projects for 'drupal'
Projects for 'excel'
Projects for 'facebook'
Projects for 'flash'
Projects for 'html'
Projects for 'java'
Projects for 'javascript'
Projects for 'joomla'
Projects for 'iphone'
Projects for 'mysql'
Projects for 'photoshop'
Projects for 'php'
Projects for 'python'
Projects for 'ruby'
Projects for 'seo'
Projects for 'sql'
Projects for 'sysadm'
Projects for 'translate'
Projects for 'typing'
Projects for 'twitter'
Projects for 'vbnet'
Projects for 'xml'
Projects for 'wordpress'
Projects for 'writing'
Read RSS feeds ... New!
RSS feed for 'android'
RSS feed for 'ajax'
RSS feed for 'asp'
RSS feed for 'aspnet'
RSS feed for 'cms'
RSS feed for 'cpp'
RSS feed for 'csharp'
RSS feed for 'css'
RSS feed for 'delphi'
RSS feed for 'design'
RSS feed for 'drupal'
RSS feed for 'excel'
RSS feed for 'facebook'
RSS feed for 'flash'
RSS feed for 'html'
RSS feed for 'java'
RSS feed for 'javascript'
RSS feed for 'joomla'
RSS feed for 'iphone'
RSS feed for 'mysql'
RSS feed for 'photoshop'
RSS feed for 'php'
RSS feed for 'python'
RSS feed for 'ruby'
RSS feed for 'seo'
RSS feed for 'sql'
RSS feed for 'sysadm'
RSS feed for 'translate'
RSS feed for 'typing'
RSS feed for 'twitter'
RSS feed for 'vbnet'
RSS feed for 'xml'
RSS feed for 'wordpress'
RSS feed for 'writing'
New!
Проекты на русском
(Projects in Russian)

Long URL:
www.1001freelanceprojects.com
Mobile version:
m.1001fp.com
Copyright © 2005-2022 1001 Freelance Projects