For school we need to write an 80x20 2d array that stores six pathways, each of which is a straight line between two randomly selected points on the perimeter of the array. My problem is that I don't know how to make it so there will be six random pathways( or lines I guess) on the 2d array, just how to make random lines on it. Can someone give me a hand, please?
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
const int rows = 80; //declares the amount of rows in the 2d array
const int cols = 20; //declares the amount of columns in the 2d array
char terminal[rows][cols];
I mean like connecting points on the perimeter on the array to form a line, inside it would be just spaces, like this:
-----
| |
| |
| |
-----
But there would six of these, one for each path, so the whole array wouldn't have a border around it.