Abacus Virtual
Apr 06, 2022
Hello heroes
I publish an example of an interaction created with state changes and basic operations with JavaScript. A virtual abacus that can help children to perform operations and develop mathematical thinking.
https://360.articulate.com/review/content/779e7988-764d-4695-bd7c-30a20cde36f6/review
9 Replies
Hi, Alejandro, and welcome to E-Learning Heroes! ✨
What a fantastic idea and project! Thank you for sharing it with the community!
Nicely done, Alejandro! And thanks for sharing your .story file. I'm looking forward to peeking under the hood on this one.
thanks for the welcome
Thanks, David. I hope you like to see what I achieve with this wonderful tool!
Really nice Alejandro. Well done!
Thank you Craig
This was interesting.
Job well done, I believe we live for others. Better we heal the world for the betterment of peace and stability.
Here is an example of a virtual abacus written in JavaScript that can perform basic operations:
javascript
Copy code
class Abacus {
constructor() {
this.value = 0;
}
add(val) {
this.value += val;
}
subtract(val) {
this.value -= val;
}
reset() {
this.value = 0;
}
getValue() {
return this.value;
}
}
const myAbacus = new Abacus();
myAbacus.add(5);
console.log(myAbacus.getValue()); // 5
myAbacus.subtract(2);
console.log(myAbacus.getValue()); // 3
myAbacus.reset();
console.log(myAbacus.getValue()); // 0
This simple implementation of an abacus uses a class with methods to add, subtract, reset and get the current value of the abacus. This can serve as a starting point for building a more complex and interactive virtual abacus for children to learn and develop their mathematical skills.