Non-recurring, Randomized, 2D Char Array That Contains Alphabet For C++ Beginner
Assignment wants from us to create a matrix 5x10 containing English letters randomly and non-recurringly. But since there are 52 letters and 50 rooms in the matrix I had to put away to of them. But if I can randomly generate them there still will me two letter missing but not the same ones.
my code is like this so far;
#include <iostream>
#include <ctime> //for srand (number randomize)
using namespace std;
int main()
{
srand(time(0)); // generates random number
const int ROWS = 5; //declaration of rows
const int COLUMNS = 10; //declaration of columns
//writing content of the matrix
//I took out two letter (v and V) because matrix limit was 50 but all letters were 52
char harf[ROWS][COLUMNS] = {
{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'},
{'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'},
{'U', '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', 'w', 'x', 'y', 'z'}
};
for (int i = 0; i < ROWS; i++)
{
for (int j = 0; j < COLUMNS; ++j)
{
//generates a random index number
int index1 = rand() % 5; //random numbers 0 to 5
int index2 = rand() % 10; //random numbers 0 to 10
//swaps harf [i][j] with harf [index1][index2] for it won't be repating itself
char temp = harf[i][j];
harf[i][j] = harf[index1][index2];
harf[index1][index2] = temp;
}
}
//printing header and random order matrix
cout << "Random and nonrecurring matrix" << endl << endl;
for (int i = 0; i < ROWS; ++i)
{
for (int j = 0; j < COLUMNS; ++j)
cout << harf[i][j] << " ";
cout << endl << endl;
}
I tried to make this way;
char harf[ROWS][COLUMNS];
for (int i = 0; i < ROWS; i++)
{ for (int j = 0; j < COLUMNS; ++j)
{
harf[i][j] = rand() % 25 + 65 && rand() % 25 + 97; } }
I also tried the same thing with " || " but does not seem to work.
Since this is an assignment I can not use anything more advanced than this kind of expressions. Can someone please tell me how to put the English alphabet into that matrix?
c++ arrays matrix
add a comment |
Assignment wants from us to create a matrix 5x10 containing English letters randomly and non-recurringly. But since there are 52 letters and 50 rooms in the matrix I had to put away to of them. But if I can randomly generate them there still will me two letter missing but not the same ones.
my code is like this so far;
#include <iostream>
#include <ctime> //for srand (number randomize)
using namespace std;
int main()
{
srand(time(0)); // generates random number
const int ROWS = 5; //declaration of rows
const int COLUMNS = 10; //declaration of columns
//writing content of the matrix
//I took out two letter (v and V) because matrix limit was 50 but all letters were 52
char harf[ROWS][COLUMNS] = {
{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'},
{'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'},
{'U', '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', 'w', 'x', 'y', 'z'}
};
for (int i = 0; i < ROWS; i++)
{
for (int j = 0; j < COLUMNS; ++j)
{
//generates a random index number
int index1 = rand() % 5; //random numbers 0 to 5
int index2 = rand() % 10; //random numbers 0 to 10
//swaps harf [i][j] with harf [index1][index2] for it won't be repating itself
char temp = harf[i][j];
harf[i][j] = harf[index1][index2];
harf[index1][index2] = temp;
}
}
//printing header and random order matrix
cout << "Random and nonrecurring matrix" << endl << endl;
for (int i = 0; i < ROWS; ++i)
{
for (int j = 0; j < COLUMNS; ++j)
cout << harf[i][j] << " ";
cout << endl << endl;
}
I tried to make this way;
char harf[ROWS][COLUMNS];
for (int i = 0; i < ROWS; i++)
{ for (int j = 0; j < COLUMNS; ++j)
{
harf[i][j] = rand() % 25 + 65 && rand() % 25 + 97; } }
I also tried the same thing with " || " but does not seem to work.
Since this is an assignment I can not use anything more advanced than this kind of expressions. Can someone please tell me how to put the English alphabet into that matrix?
c++ arrays matrix
2
Start with a list of all uppercase and lowercase letters in a separate, one dimensional array. Remove two at random. Then, swap each element in that array with a random element selected from anywhere within the array. (This is "shuffle" randomization known to players of card games and MP3 files.) Then put the results into your 2D array,
– Tim Randall
Nov 21 '18 at 19:40
With the exception of removing two letters at random, your attempt seems to be doing pretty much what I said. What's wrong with your approach?
– Tim Randall
Nov 21 '18 at 19:43
I have to use a 2d array and I have to use only 1 according to the assignment. I made something like this : ` for (int i = 0; i < ROWS; i++) { for (int j = 0; j < 5; ++j) { harf[i][j] = rand() % 25 + 'A'; } } for (int i = 0; i < ROWS; i++) { for (int j = 5; j < 10; ++j) { harf[i][j] = rand() % 25 + 'a'; } } ` but it is repeating characters. @TimRandall @Mpops
– Eksiqilta
Nov 23 '18 at 15:35
Btw nothing is wrong except mine is missing V and v all the time but it should be randomly like everytime 2 letters will be missing but different. But I can not create two separate matrix or other 1d arrays.
– Eksiqilta
Nov 23 '18 at 15:40
add a comment |
Assignment wants from us to create a matrix 5x10 containing English letters randomly and non-recurringly. But since there are 52 letters and 50 rooms in the matrix I had to put away to of them. But if I can randomly generate them there still will me two letter missing but not the same ones.
my code is like this so far;
#include <iostream>
#include <ctime> //for srand (number randomize)
using namespace std;
int main()
{
srand(time(0)); // generates random number
const int ROWS = 5; //declaration of rows
const int COLUMNS = 10; //declaration of columns
//writing content of the matrix
//I took out two letter (v and V) because matrix limit was 50 but all letters were 52
char harf[ROWS][COLUMNS] = {
{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'},
{'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'},
{'U', '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', 'w', 'x', 'y', 'z'}
};
for (int i = 0; i < ROWS; i++)
{
for (int j = 0; j < COLUMNS; ++j)
{
//generates a random index number
int index1 = rand() % 5; //random numbers 0 to 5
int index2 = rand() % 10; //random numbers 0 to 10
//swaps harf [i][j] with harf [index1][index2] for it won't be repating itself
char temp = harf[i][j];
harf[i][j] = harf[index1][index2];
harf[index1][index2] = temp;
}
}
//printing header and random order matrix
cout << "Random and nonrecurring matrix" << endl << endl;
for (int i = 0; i < ROWS; ++i)
{
for (int j = 0; j < COLUMNS; ++j)
cout << harf[i][j] << " ";
cout << endl << endl;
}
I tried to make this way;
char harf[ROWS][COLUMNS];
for (int i = 0; i < ROWS; i++)
{ for (int j = 0; j < COLUMNS; ++j)
{
harf[i][j] = rand() % 25 + 65 && rand() % 25 + 97; } }
I also tried the same thing with " || " but does not seem to work.
Since this is an assignment I can not use anything more advanced than this kind of expressions. Can someone please tell me how to put the English alphabet into that matrix?
c++ arrays matrix
Assignment wants from us to create a matrix 5x10 containing English letters randomly and non-recurringly. But since there are 52 letters and 50 rooms in the matrix I had to put away to of them. But if I can randomly generate them there still will me two letter missing but not the same ones.
my code is like this so far;
#include <iostream>
#include <ctime> //for srand (number randomize)
using namespace std;
int main()
{
srand(time(0)); // generates random number
const int ROWS = 5; //declaration of rows
const int COLUMNS = 10; //declaration of columns
//writing content of the matrix
//I took out two letter (v and V) because matrix limit was 50 but all letters were 52
char harf[ROWS][COLUMNS] = {
{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'},
{'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'},
{'U', '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', 'w', 'x', 'y', 'z'}
};
for (int i = 0; i < ROWS; i++)
{
for (int j = 0; j < COLUMNS; ++j)
{
//generates a random index number
int index1 = rand() % 5; //random numbers 0 to 5
int index2 = rand() % 10; //random numbers 0 to 10
//swaps harf [i][j] with harf [index1][index2] for it won't be repating itself
char temp = harf[i][j];
harf[i][j] = harf[index1][index2];
harf[index1][index2] = temp;
}
}
//printing header and random order matrix
cout << "Random and nonrecurring matrix" << endl << endl;
for (int i = 0; i < ROWS; ++i)
{
for (int j = 0; j < COLUMNS; ++j)
cout << harf[i][j] << " ";
cout << endl << endl;
}
I tried to make this way;
char harf[ROWS][COLUMNS];
for (int i = 0; i < ROWS; i++)
{ for (int j = 0; j < COLUMNS; ++j)
{
harf[i][j] = rand() % 25 + 65 && rand() % 25 + 97; } }
I also tried the same thing with " || " but does not seem to work.
Since this is an assignment I can not use anything more advanced than this kind of expressions. Can someone please tell me how to put the English alphabet into that matrix?
c++ arrays matrix
c++ arrays matrix
asked Nov 21 '18 at 19:32
EksiqiltaEksiqilta
1
1
2
Start with a list of all uppercase and lowercase letters in a separate, one dimensional array. Remove two at random. Then, swap each element in that array with a random element selected from anywhere within the array. (This is "shuffle" randomization known to players of card games and MP3 files.) Then put the results into your 2D array,
– Tim Randall
Nov 21 '18 at 19:40
With the exception of removing two letters at random, your attempt seems to be doing pretty much what I said. What's wrong with your approach?
– Tim Randall
Nov 21 '18 at 19:43
I have to use a 2d array and I have to use only 1 according to the assignment. I made something like this : ` for (int i = 0; i < ROWS; i++) { for (int j = 0; j < 5; ++j) { harf[i][j] = rand() % 25 + 'A'; } } for (int i = 0; i < ROWS; i++) { for (int j = 5; j < 10; ++j) { harf[i][j] = rand() % 25 + 'a'; } } ` but it is repeating characters. @TimRandall @Mpops
– Eksiqilta
Nov 23 '18 at 15:35
Btw nothing is wrong except mine is missing V and v all the time but it should be randomly like everytime 2 letters will be missing but different. But I can not create two separate matrix or other 1d arrays.
– Eksiqilta
Nov 23 '18 at 15:40
add a comment |
2
Start with a list of all uppercase and lowercase letters in a separate, one dimensional array. Remove two at random. Then, swap each element in that array with a random element selected from anywhere within the array. (This is "shuffle" randomization known to players of card games and MP3 files.) Then put the results into your 2D array,
– Tim Randall
Nov 21 '18 at 19:40
With the exception of removing two letters at random, your attempt seems to be doing pretty much what I said. What's wrong with your approach?
– Tim Randall
Nov 21 '18 at 19:43
I have to use a 2d array and I have to use only 1 according to the assignment. I made something like this : ` for (int i = 0; i < ROWS; i++) { for (int j = 0; j < 5; ++j) { harf[i][j] = rand() % 25 + 'A'; } } for (int i = 0; i < ROWS; i++) { for (int j = 5; j < 10; ++j) { harf[i][j] = rand() % 25 + 'a'; } } ` but it is repeating characters. @TimRandall @Mpops
– Eksiqilta
Nov 23 '18 at 15:35
Btw nothing is wrong except mine is missing V and v all the time but it should be randomly like everytime 2 letters will be missing but different. But I can not create two separate matrix or other 1d arrays.
– Eksiqilta
Nov 23 '18 at 15:40
2
2
Start with a list of all uppercase and lowercase letters in a separate, one dimensional array. Remove two at random. Then, swap each element in that array with a random element selected from anywhere within the array. (This is "shuffle" randomization known to players of card games and MP3 files.) Then put the results into your 2D array,
– Tim Randall
Nov 21 '18 at 19:40
Start with a list of all uppercase and lowercase letters in a separate, one dimensional array. Remove two at random. Then, swap each element in that array with a random element selected from anywhere within the array. (This is "shuffle" randomization known to players of card games and MP3 files.) Then put the results into your 2D array,
– Tim Randall
Nov 21 '18 at 19:40
With the exception of removing two letters at random, your attempt seems to be doing pretty much what I said. What's wrong with your approach?
– Tim Randall
Nov 21 '18 at 19:43
With the exception of removing two letters at random, your attempt seems to be doing pretty much what I said. What's wrong with your approach?
– Tim Randall
Nov 21 '18 at 19:43
I have to use a 2d array and I have to use only 1 according to the assignment. I made something like this : ` for (int i = 0; i < ROWS; i++) { for (int j = 0; j < 5; ++j) { harf[i][j] = rand() % 25 + 'A'; } } for (int i = 0; i < ROWS; i++) { for (int j = 5; j < 10; ++j) { harf[i][j] = rand() % 25 + 'a'; } } ` but it is repeating characters. @TimRandall @Mpops
– Eksiqilta
Nov 23 '18 at 15:35
I have to use a 2d array and I have to use only 1 according to the assignment. I made something like this : ` for (int i = 0; i < ROWS; i++) { for (int j = 0; j < 5; ++j) { harf[i][j] = rand() % 25 + 'A'; } } for (int i = 0; i < ROWS; i++) { for (int j = 5; j < 10; ++j) { harf[i][j] = rand() % 25 + 'a'; } } ` but it is repeating characters. @TimRandall @Mpops
– Eksiqilta
Nov 23 '18 at 15:35
Btw nothing is wrong except mine is missing V and v all the time but it should be randomly like everytime 2 letters will be missing but different. But I can not create two separate matrix or other 1d arrays.
– Eksiqilta
Nov 23 '18 at 15:40
Btw nothing is wrong except mine is missing V and v all the time but it should be randomly like everytime 2 letters will be missing but different. But I can not create two separate matrix or other 1d arrays.
– Eksiqilta
Nov 23 '18 at 15:40
add a comment |
1 Answer
1
active
oldest
votes
- Create array of length 52.
- Fill this array with the letters of the alphabet, in order if you want.
[abcde.....XYZ]
- Shuffle the entire array.
[dPYka....slqEr]
- Remove the last two characters in the array.
[dPYka...slq]
- Now, to access your random letters, simply read either the first or last character in the array and remove it each time you read one.
[dPYka...slq]
-->[dPYka...sl]
(read a 'q') - Fill your 2 dimensional array by accessing one letter at a time from this array, making sure to remove letters as you go.
If you do it this way, the random letters removed will be purely random (ha*) and the final 5x10 matrix will also be purely random (ha*).
*let's not get into the properties of truly random number generators.
No need in steps 4,5,6 to remove letters. just walk through the first 50 array elements and enter them sequentially in the 5x10 matrix
– doug
Nov 21 '18 at 22:54
I am only allowed to create one matrix (I know it is dumb). but thanks for your answer.
– Eksiqilta
Nov 23 '18 at 15:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53419317%2fnon-recurring-randomized-2d-char-array-that-contains-alphabet-for-c-beginner%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
- Create array of length 52.
- Fill this array with the letters of the alphabet, in order if you want.
[abcde.....XYZ]
- Shuffle the entire array.
[dPYka....slqEr]
- Remove the last two characters in the array.
[dPYka...slq]
- Now, to access your random letters, simply read either the first or last character in the array and remove it each time you read one.
[dPYka...slq]
-->[dPYka...sl]
(read a 'q') - Fill your 2 dimensional array by accessing one letter at a time from this array, making sure to remove letters as you go.
If you do it this way, the random letters removed will be purely random (ha*) and the final 5x10 matrix will also be purely random (ha*).
*let's not get into the properties of truly random number generators.
No need in steps 4,5,6 to remove letters. just walk through the first 50 array elements and enter them sequentially in the 5x10 matrix
– doug
Nov 21 '18 at 22:54
I am only allowed to create one matrix (I know it is dumb). but thanks for your answer.
– Eksiqilta
Nov 23 '18 at 15:32
add a comment |
- Create array of length 52.
- Fill this array with the letters of the alphabet, in order if you want.
[abcde.....XYZ]
- Shuffle the entire array.
[dPYka....slqEr]
- Remove the last two characters in the array.
[dPYka...slq]
- Now, to access your random letters, simply read either the first or last character in the array and remove it each time you read one.
[dPYka...slq]
-->[dPYka...sl]
(read a 'q') - Fill your 2 dimensional array by accessing one letter at a time from this array, making sure to remove letters as you go.
If you do it this way, the random letters removed will be purely random (ha*) and the final 5x10 matrix will also be purely random (ha*).
*let's not get into the properties of truly random number generators.
No need in steps 4,5,6 to remove letters. just walk through the first 50 array elements and enter them sequentially in the 5x10 matrix
– doug
Nov 21 '18 at 22:54
I am only allowed to create one matrix (I know it is dumb). but thanks for your answer.
– Eksiqilta
Nov 23 '18 at 15:32
add a comment |
- Create array of length 52.
- Fill this array with the letters of the alphabet, in order if you want.
[abcde.....XYZ]
- Shuffle the entire array.
[dPYka....slqEr]
- Remove the last two characters in the array.
[dPYka...slq]
- Now, to access your random letters, simply read either the first or last character in the array and remove it each time you read one.
[dPYka...slq]
-->[dPYka...sl]
(read a 'q') - Fill your 2 dimensional array by accessing one letter at a time from this array, making sure to remove letters as you go.
If you do it this way, the random letters removed will be purely random (ha*) and the final 5x10 matrix will also be purely random (ha*).
*let's not get into the properties of truly random number generators.
- Create array of length 52.
- Fill this array with the letters of the alphabet, in order if you want.
[abcde.....XYZ]
- Shuffle the entire array.
[dPYka....slqEr]
- Remove the last two characters in the array.
[dPYka...slq]
- Now, to access your random letters, simply read either the first or last character in the array and remove it each time you read one.
[dPYka...slq]
-->[dPYka...sl]
(read a 'q') - Fill your 2 dimensional array by accessing one letter at a time from this array, making sure to remove letters as you go.
If you do it this way, the random letters removed will be purely random (ha*) and the final 5x10 matrix will also be purely random (ha*).
*let's not get into the properties of truly random number generators.
answered Nov 21 '18 at 21:40
MPopsMPops
2356
2356
No need in steps 4,5,6 to remove letters. just walk through the first 50 array elements and enter them sequentially in the 5x10 matrix
– doug
Nov 21 '18 at 22:54
I am only allowed to create one matrix (I know it is dumb). but thanks for your answer.
– Eksiqilta
Nov 23 '18 at 15:32
add a comment |
No need in steps 4,5,6 to remove letters. just walk through the first 50 array elements and enter them sequentially in the 5x10 matrix
– doug
Nov 21 '18 at 22:54
I am only allowed to create one matrix (I know it is dumb). but thanks for your answer.
– Eksiqilta
Nov 23 '18 at 15:32
No need in steps 4,5,6 to remove letters. just walk through the first 50 array elements and enter them sequentially in the 5x10 matrix
– doug
Nov 21 '18 at 22:54
No need in steps 4,5,6 to remove letters. just walk through the first 50 array elements and enter them sequentially in the 5x10 matrix
– doug
Nov 21 '18 at 22:54
I am only allowed to create one matrix (I know it is dumb). but thanks for your answer.
– Eksiqilta
Nov 23 '18 at 15:32
I am only allowed to create one matrix (I know it is dumb). but thanks for your answer.
– Eksiqilta
Nov 23 '18 at 15:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53419317%2fnon-recurring-randomized-2d-char-array-that-contains-alphabet-for-c-beginner%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Start with a list of all uppercase and lowercase letters in a separate, one dimensional array. Remove two at random. Then, swap each element in that array with a random element selected from anywhere within the array. (This is "shuffle" randomization known to players of card games and MP3 files.) Then put the results into your 2D array,
– Tim Randall
Nov 21 '18 at 19:40
With the exception of removing two letters at random, your attempt seems to be doing pretty much what I said. What's wrong with your approach?
– Tim Randall
Nov 21 '18 at 19:43
I have to use a 2d array and I have to use only 1 according to the assignment. I made something like this : ` for (int i = 0; i < ROWS; i++) { for (int j = 0; j < 5; ++j) { harf[i][j] = rand() % 25 + 'A'; } } for (int i = 0; i < ROWS; i++) { for (int j = 5; j < 10; ++j) { harf[i][j] = rand() % 25 + 'a'; } } ` but it is repeating characters. @TimRandall @Mpops
– Eksiqilta
Nov 23 '18 at 15:35
Btw nothing is wrong except mine is missing V and v all the time but it should be randomly like everytime 2 letters will be missing but different. But I can not create two separate matrix or other 1d arrays.
– Eksiqilta
Nov 23 '18 at 15:40