Multiplying two arrays
$begingroup$
I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.
Main points:
- How to make the scanf_s for both int a and int b in one "piece of code"
- Any other suggestions for example what I should be wary of, should/shouldn't use etc.
Thanks for the help and also for bearing with me.
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}
return 0;
}
c++ matrix
New contributor
$endgroup$
add a comment |
$begingroup$
I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.
Main points:
- How to make the scanf_s for both int a and int b in one "piece of code"
- Any other suggestions for example what I should be wary of, should/shouldn't use etc.
Thanks for the help and also for bearing with me.
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}
return 0;
}
c++ matrix
New contributor
$endgroup$
2
$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago
3
$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago
add a comment |
$begingroup$
I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.
Main points:
- How to make the scanf_s for both int a and int b in one "piece of code"
- Any other suggestions for example what I should be wary of, should/shouldn't use etc.
Thanks for the help and also for bearing with me.
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}
return 0;
}
c++ matrix
New contributor
$endgroup$
I would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array.
Main points:
- How to make the scanf_s for both int a and int b in one "piece of code"
- Any other suggestions for example what I should be wary of, should/shouldn't use etc.
Thanks for the help and also for bearing with me.
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a[3][4];
int b[4][3];
int c[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej a[" << j << "," << l << "]: ";
scanf_s("%d", &a[j][l]);
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
cout << "Zadej b[" << j << "," << l << "]: ";
scanf_s("%d", &b[j][l]);
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
printf(" |%d| ", c[j][l] += a[j][l] * b[j][l]);
}
printf("n");
}
return 0;
}
c++ matrix
c++ matrix
New contributor
New contributor
edited 12 mins ago
Toby Speight
23.8k639113
23.8k639113
New contributor
asked 1 hour ago
Patrik ŠoukalPatrik Šoukal
11
11
New contributor
New contributor
2
$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago
3
$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago
add a comment |
2
$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago
3
$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago
2
2
$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago
$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago
3
3
$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago
$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Don't put everything into one big main()
If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.
Avoid non-standard libraries
Here we have "stdafx.h"
and scanf_s
that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]
).
Include what you use
We don't seem to use <cmath>
anywhere, so let's drop that. We'll need <cstdlib>
for std::printf()
- or switch to C++ style output using <iostream>
.
Avoid using the whole std
namespace
The std
namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std::
- it's intentionally very short.
Use C++ collections
It's easier to work with the C++ collection types such as std::array
or std::vector
than with raw (C-style) arrays (which decay to pointers when passed as function arguments).
$endgroup$
add a comment |
$begingroup$
So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?
#include <cstdlib>
#include <iostream>
#include <string>
#include <array>
int main()
{
std::array<int, 3> a;
std::array<int, 4> b;
std::array<int, 3> c;
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej a[" << j << "," << l << "]: ";
std::cin >> a;
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej b[" << j << "," << l << "]: ";
std::cin >> b;
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
std::printf(" |%d| ", c += a * b);
}
std::printf("n");
}
return 0;
}
New contributor
$endgroup$
1
$begingroup$
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
$endgroup$
– Sᴀᴍ Onᴇᴌᴀ
12 mins ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");
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: "196"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
});
}
});
Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.
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%2fcodereview.stackexchange.com%2fquestions%2f211634%2fmultiplying-two-arrays%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Don't put everything into one big main()
If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.
Avoid non-standard libraries
Here we have "stdafx.h"
and scanf_s
that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]
).
Include what you use
We don't seem to use <cmath>
anywhere, so let's drop that. We'll need <cstdlib>
for std::printf()
- or switch to C++ style output using <iostream>
.
Avoid using the whole std
namespace
The std
namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std::
- it's intentionally very short.
Use C++ collections
It's easier to work with the C++ collection types such as std::array
or std::vector
than with raw (C-style) arrays (which decay to pointers when passed as function arguments).
$endgroup$
add a comment |
$begingroup$
Don't put everything into one big main()
If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.
Avoid non-standard libraries
Here we have "stdafx.h"
and scanf_s
that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]
).
Include what you use
We don't seem to use <cmath>
anywhere, so let's drop that. We'll need <cstdlib>
for std::printf()
- or switch to C++ style output using <iostream>
.
Avoid using the whole std
namespace
The std
namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std::
- it's intentionally very short.
Use C++ collections
It's easier to work with the C++ collection types such as std::array
or std::vector
than with raw (C-style) arrays (which decay to pointers when passed as function arguments).
$endgroup$
add a comment |
$begingroup$
Don't put everything into one big main()
If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.
Avoid non-standard libraries
Here we have "stdafx.h"
and scanf_s
that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]
).
Include what you use
We don't seem to use <cmath>
anywhere, so let's drop that. We'll need <cstdlib>
for std::printf()
- or switch to C++ style output using <iostream>
.
Avoid using the whole std
namespace
The std
namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std::
- it's intentionally very short.
Use C++ collections
It's easier to work with the C++ collection types such as std::array
or std::vector
than with raw (C-style) arrays (which decay to pointers when passed as function arguments).
$endgroup$
Don't put everything into one big main()
If you can separate out the reading of inputs and writing of results from the actual multiplications, then it will be easier to test the multiplication code separately.
Avoid non-standard libraries
Here we have "stdafx.h"
and scanf_s
that aren't part of standard C++. Ditch those and use the standard facilities (e.g. std::cin >> a[j][l]
).
Include what you use
We don't seem to use <cmath>
anywhere, so let's drop that. We'll need <cstdlib>
for std::printf()
- or switch to C++ style output using <iostream>
.
Avoid using the whole std
namespace
The std
namespace isn't one of the few that's designed to be imported wholesale like that, and there's potential for name conflicts when moving to a new standards version. Specify just the names you need, or just get used to writing std::
- it's intentionally very short.
Use C++ collections
It's easier to work with the C++ collection types such as std::array
or std::vector
than with raw (C-style) arrays (which decay to pointers when passed as function arguments).
answered 1 hour ago
Toby SpeightToby Speight
23.8k639113
23.8k639113
add a comment |
add a comment |
$begingroup$
So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?
#include <cstdlib>
#include <iostream>
#include <string>
#include <array>
int main()
{
std::array<int, 3> a;
std::array<int, 4> b;
std::array<int, 3> c;
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej a[" << j << "," << l << "]: ";
std::cin >> a;
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej b[" << j << "," << l << "]: ";
std::cin >> b;
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
std::printf(" |%d| ", c += a * b);
}
std::printf("n");
}
return 0;
}
New contributor
$endgroup$
1
$begingroup$
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
$endgroup$
– Sᴀᴍ Onᴇᴌᴀ
12 mins ago
add a comment |
$begingroup$
So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?
#include <cstdlib>
#include <iostream>
#include <string>
#include <array>
int main()
{
std::array<int, 3> a;
std::array<int, 4> b;
std::array<int, 3> c;
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej a[" << j << "," << l << "]: ";
std::cin >> a;
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej b[" << j << "," << l << "]: ";
std::cin >> b;
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
std::printf(" |%d| ", c += a * b);
}
std::printf("n");
}
return 0;
}
New contributor
$endgroup$
1
$begingroup$
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
$endgroup$
– Sᴀᴍ Onᴇᴌᴀ
12 mins ago
add a comment |
$begingroup$
So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?
#include <cstdlib>
#include <iostream>
#include <string>
#include <array>
int main()
{
std::array<int, 3> a;
std::array<int, 4> b;
std::array<int, 3> c;
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej a[" << j << "," << l << "]: ";
std::cin >> a;
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej b[" << j << "," << l << "]: ";
std::cin >> b;
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
std::printf(" |%d| ", c += a * b);
}
std::printf("n");
}
return 0;
}
New contributor
$endgroup$
So I edited the code a bit but now it posts an error: "no operator "<<" matches these operands". Also now that I removed the brackets how am I supposed to change the x/y the same way I did before?
#include <cstdlib>
#include <iostream>
#include <string>
#include <array>
int main()
{
std::array<int, 3> a;
std::array<int, 4> b;
std::array<int, 3> c;
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej a[" << j << "," << l << "]: ";
std::cin >> a;
}
}
for (int j = 0; j != 4; j++)
{
for (int l = 0; l != 4; l++)
{
std::cout << "Zadej b[" << j << "," << l << "]: ";
std::cin >> b;
}
}
for (int j = 0; j != 3; j++)
{
for (int l = 0; l != 3; l++)
{
;
std::printf(" |%d| ", c += a * b);
}
std::printf("n");
}
return 0;
}
New contributor
New contributor
answered 33 mins ago
Patrik ŠoukalPatrik Šoukal
11
11
New contributor
New contributor
1
$begingroup$
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
$endgroup$
– Sᴀᴍ Onᴇᴌᴀ
12 mins ago
add a comment |
1
$begingroup$
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
$endgroup$
– Sᴀᴍ Onᴇᴌᴀ
12 mins ago
1
1
$begingroup$
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
$endgroup$
– Sᴀᴍ Onᴇᴌᴀ
12 mins ago
$begingroup$
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
$endgroup$
– Sᴀᴍ Onᴇᴌᴀ
12 mins ago
add a comment |
Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.
Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.
Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.
Patrik Šoukal is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- 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.
Use MathJax to format equations. MathJax reference.
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%2fcodereview.stackexchange.com%2fquestions%2f211634%2fmultiplying-two-arrays%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
$begingroup$
"Is the code working the right way ?" It's you who's in charge to ensure that, before asking for a review here.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
Don't take me the wrong way, it is working but I have never done anything with matrixes yet so I am not sure if I'm counting it the right way.
$endgroup$
– Patrik Šoukal
1 hour ago
3
$begingroup$
Write appropriate test cases first to the best of your knowledge.
$endgroup$
– πάντα ῥεῖ
1 hour ago
$begingroup$
@πάντα ῥεῖ I am absolutely certain that it works the right way so if you could kindly help me with the other two points I would be glad.
$endgroup$
– Patrik Šoukal
1 hour ago