-
Notifications
You must be signed in to change notification settings - Fork 154
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.)
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; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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')
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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') { |
There was a problem hiding this comment.
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
No description provided.