Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrices Course and Gauss Solver #307

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open

Conversation

kevindeland
Copy link
Contributor

No description provided.

Copy link
Member

@plegner plegner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! You can remove the left.svg and right.svg files, and there is also a bit of code cleanup we can do, e.g. removing/commenting out) the all console.log statements. (This last part could happen in a later PR if you prefer, or are still working on those components.)

@plegner plegner mentioned this pull request Feb 9, 2021
move: (p: Point) => {
// Check that this row not equal to the other output
const row = clamp(Math.round((p.y - 20) / 40), 0, this.size - 1);
this.model[key] = row;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the output rows need to be interactive right? They are the same (or swapped) as the input rows


if (this.checkForSolvedIdentity()) {
console.log('Success!');
this.$step.tools.confetti();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than showing confetti, maybe something more subtle like this.$step.addHint('correct')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's definitely more appropriate, I just really wanted a chance to use the confetti 😆

let expr;
let value;
try {
// FIXME: @philipp this might throw an error, Not sure how else to handle it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I would just make factor a number (e.g. 1 or 0.5). We can allow things like 1/2 in the future, but then we should use a proper equation editor rather than an input field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try this for now, but I'm not sure it would work with numbers like 1/3 or 1/12.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things to try:
(a) Rounding? With error margins?
(b) Just switch the problems until we add the expression editor.
(c) Ignore the problem (but China matrix will be close to unsolvable, as checkForSolvedIdentity checks for exact value)

for (let j = 0; j < numRows; j++) {
// console.log(`Checking row=${i}; col=${j}; value=${values[j]}`);
if (j === i) {
if (values[j].text != '1') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid storing state in the DOM. Rather than accessing .text (which is quite an expensive operation), we should just have a numeric, nested array that contains the current value of the output matrix

@plegner plegner changed the title Gauss solver from Monday meeting, with functionality added. Matrices Course and Gauss Solver Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants