Find Jobs
Hire Freelancers

2 dimensional array

$10-30 USD

ที่ทำเสร็จแล้ว
โพสต์ มากกว่า 9 ปีที่ผ่านมา

$10-30 USD

ชำระเงินเมื่อส่งงาน
Write a C++ program, [login to view URL], that randomly finds a path from the center of a two dimensional array. The program first initializes a two dimensional char array to all periods. The program starts at the middle of the array. It places an ‘a’ at this spot in the array. It then repeatedly picks a random direction (up, down, left or right) that travels to a spot not yet visited and places the next letter of the alphabet there. The program stops when the pathway reaches an edge of the array or there is no legal spot to move. You are required to write the following functions to help solve the problem: // set all spots in the board equal to period // characters void init_board (char board [max_row][max_col]); // sets row and col equal to a new row and column using // a random move (up, down, left or right) to a spot in // the array not yet visited void move (char box[max_row][max_col], int& row, int& col); // function returns true if there is no legal move (up, // down, right, or left) from current row and column. bool fail (char box[max_row][max_col], int row, int col); // function returns true if the edge of the box has been // reached bool success (int row, int col); // prints the array in two dimensional format with // a single linefeed between rows and no spaces. void print (char box [max_row][max_col]); // returns the next character to be printed in the path // given the current character. Letters change from // lowercase to uppercase to lowercase… char next (char current); max_row and max_col are constants giving the size of the array. The program should work for different values of max_row and max_col. When the lowercase alphabet is exhausted, the markers should change to the uppercase alphabet. When the uppercase alphabet is exhausted, the markers should change back to lowercase alphabet, and so on. If an edge of the array is reached, the word “Success” should be printed along with the array. When there is no legal move from a spot, the word “Failure” should be printed along with the array. Two runs of the program with max_row = 20 and max_col = 50 are shown on the next page of this handout. The program should run differently each run. When done, place the [login to view URL] file in the Homework 2 assignment area on Blackboard. Run 1 (max_row = 20, max_col = 30): Success! The path is: .............................. .............................. .............................. .............................. .............................. .............................. .............................. .............................. .........................vwzA. ...............a.........uxyBC .............feb.....VWXst.... .............gdcPQRSTU.Yr..... ............ih..ON.....Zqp.... ............juv..M.....ano.... ..........mlktw.KLGF...bml.... ..........norsxyJIHE...c.kji.. ...........pq..zABCD...defgh.. .............................. .............................. .............................. Run 2 (max_row = 15, max_col = 30): Failure! The path is: .............................. .............................. .............................. .............................. .............................. ............gf................ ............hedc.............. .........nmli..b.............. .........oxkj..a.............. .........pwv.................. .........q.u.................. .........rst.................. .............................. .............................. ..............................
รหัสโปรเจกต์: 6494227

เกี่ยวกับโปรเจกต์

6 ข้อเสนอ
โปรเจกต์ระยะไกล
ใช้งานอยู่ 10 ปีที่ผ่านมา

กำลังมองหาการสร้างรายได้ใช่ไหม?

ประโยชน์ของการประมูลกับ Freelancer

กำหนดงบประมาณและกรอบเวลาของคุณ
รับเงินจากการงานของคุณ
อธิบายข้อเสนอของคุณในภาพรวม
ลงทะเบียนและเสนอราคาฟรี
หมอบหมายให้:
รูปอวาตาร์ของผู้ใช้
Hi there, I've already read and understood the project requirement, and I can complete this one for you. So really hope to have chance to work with you, thanks for your consideration! Regards.
$30 USD ใน 0 วัน
5.0 (24 รีวิว)
4.2
4.2
6 ฟรีแลนซ์กำลังเสนอราคาโดยเฉลี่ย $46 USD สำหรับงานนี้
รูปอวาตาร์ของผู้ใช้
hello.............message me ...........i would like to work on this...........i have very good experience in programming..............i can get your work done very quickly..........waiting for your response..thanks & regards
$25 USD ใน 1 วัน
4.6 (24 รีวิว)
3.6
3.6
รูปอวาตาร์ของผู้ใช้
I could help you. . . .
$40 USD ใน 1 วัน
4.9 (5 รีวิว)
2.8
2.8
รูปอวาตาร์ของผู้ใช้
can do iit...........................................................................................
$111 USD ใน 1 วัน
5.0 (1 รีวิว)
1.9
1.9
รูปอวาตาร์ของผู้ใช้
Everything you need will be implemented in the program. Centered 'A' going in random direction every time. Pick me and you will not be disappointed. Thank you :) Have a nice day.
$35 USD ใน 3 วัน
0.0 (0 รีวิว)
0.0
0.0
รูปอวาตาร์ของผู้ใช้
I can start right away. Can get it done in 4-6 hours tops. Have a lot of experience in c/c++ developing. Been studying it for 6 ears now. Waiting for you response.
$25 USD ใน 0 วัน
0.0 (0 รีวิว)
0.0
0.0

เกี่ยวกับลูกค้า

ปักธงของ UNITED STATES
new york, United States
5.0
3
เป็นสมาชิกตั้งแต่ ก.ย. 23, 2014

การยืนยันลูกค้า

งานอื่นๆ จากลูกค้ารายนี้

Hamming code questions
$10-30 USD
Runner using struct
$10-30 USD
ขอบคุณ! เราได้ส่งลิงก์สำหรับเครดิตฟรีให้คุณทางอีเมลแล้ว
เกิดข้อผิดพลาดขณะส่งอีเมลของคุณ กรุณาลองอีกครั้ง
โลโก้ Freelancer Thailand / ภาษาไทย ช่วยเหลือและสนับสนุน FreelancerประเภทโปรเจคการประกวดFreelancerองค์กรแพ็กเกจสมาชิกโครงการ Freelancer ชั้นแนวหน้าการจัดการโปรเจคงานในพื้นที่Photo Anywhereหน้าจัดแสดงผลงานAPI สำหรับนักพัฒนาได้รับการยืนยันDesktop App เกี่ยวกับเกี่ยวกับเราวิธีใช้งานความปลอดภัยนักลงทุนแผนผังเว็บไซต์เรื่องราวข่าวออกสื่อทีมรางวัลข่าวประชาสัมพันธ์ร่วมงานกับเรา ข้อกำหนดนโยบายความเป็นส่วนตัวข้อกำหนดและเงื่อนไขนโยบายลิขสิทธิ์ข้อพึงปฏิบัติค่าธรรมเนียมและค่าบริการหุ้นส่วนEscrow.comLoadshiftWarrior Forum แอปโลโก้ Apple App Store โลโก้ Google Play
ไม่สามารถคัดลอกไปยังคลิปบอร์ดได้ โปรดลองอีกครั้งหลังปรับเปลี่ยนการอนุญาต
คัดลอกไปยังคลิปบอร์ดแล้ว
ผู้ใช้ที่ลงทะเบียน งานที่มีการโพสต์ทั้งหมด
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
กำลังโหลดตัวอย่าง
ได้รับอนุญาตสำหรับตำแหน่งทางภูมิศาสตร์
เซสชั่นการเข้าสู่ระบบของคุณหมดอายุและคุณได้ออกจากระบบแล้ว กรุณาเข้าสู่ระบบอีกครั้ง