kazuhikoarase / simcirjs

A circuit simulator in HTML5 and JavaScript
https://kazuhikoarase.github.io/simcirjs/
MIT License
291 stars 152 forks source link

Conditional simulator #23

Open NewbieXII opened 2 years ago

NewbieXII commented 2 years ago

can u create a simulator with condition where only specific device can be found in the workspace? help me out :( i have been doing code and i can't perfect it. :(

kazuhikoarase commented 2 years ago

Hi, It mean that you don't want full devices?

NewbieXII commented 2 years ago

your system is ok... it was awesome.. but it occur to my mind what if i want a quiz based instead freestyle simulating. i just want to add a condition based where if the connection is correct or not correct based on given question... you know like teaching based.

NewbieXII commented 2 years ago

sorry ..just newbie in this programming but i want to become programmer just like you

kazuhikoarase commented 2 years ago

Could you send me a drawing your imaging?

kazuhikoarase commented 2 years ago

It can paste here like this. image

NewbieXII commented 2 years ago

hmm...... like this GIven Instruction is here

device here and workspace is here

on the bottom of these there is button where will dictate if your work in your working space is correct based on the given instruction. if the instruction is not follow then the it will trigger that there is something wrong to your work like you are answering a question to a quiz. if your answer is correct then you can go to the next number if your answer is wrong then you need to check your work... like that .. i hope you understand.. sorry for my english

NewbieXII commented 2 years ago

Untitled

example in given instuction... you need to put LED,DC, and connect them. if the user click the button and follow the given instruction and pop you are correct then the user do another one. just like that hehe

NewbieXII commented 2 years ago

sorry for my english i hope i deliver my message correctly.. i really sorry.

kazuhikoarase commented 2 years ago

What's this button's label? I could not read it. SVD ? image

NewbieXII commented 2 years ago

that button is submit

kazuhikoarase commented 2 years ago

Is your image as follows?

Step1. First exam. image Step2. User solve it. image Step3. Confirm it. image Step4. Go to next exam. image

NewbieXII commented 2 years ago

yeah like that... can i have the code? PLEASEEE :(((

NewbieXII commented 2 years ago

i have been struggle in doing that ... :( help mee please.

kazuhikoarase commented 2 years ago

Current source is here. But it's hard to implement to check why a current circuit is correct.

<!doctype html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <script type="text/javascript" src="simcir.js"></script>
    <link rel="stylesheet" type="text/css" href="simcir.css" />
    <script type="text/javascript" src="simcir-basicset.js"></script>
    <link rel="stylesheet" type="text/css" href="simcir-basicset.css" />
    <script type="text/javascript" src="simcir-library.js"></script>
    <style>
.frame {
  padding: 16px;
  display: inline-block;
  border: 1px solid #000;
}
.instuction {
  padding: 4px 8px;
  margin: 8px 4px;
  display: inline-block;
  background-color: #ccc;
  font-size: 16pt;
}
.button {
  font-size: 16pt;
}
    </style>
    <title></title>
  </head>
  <body>
  <div class="frame">
    <div class="instuction">Instuction here</div>
    <div class="simcir">
    <!-- paste here your circuit data -->
{
  "width":400,
  "height":200,
  "showToolbox":true,
  "toolbox":[
    {"type":"DC"},
    {"type":"LED"}
  ],
  "devices":[
  ],
  "connectors":[
  ]
}
    </div>
    <button class="button" onclick="alert('Correct!')"> SUBMIT </button>
  </div>
  </body>
</html>
JamesNewton commented 2 years ago

Is it enough to check that it gives the correct output for all possible inputs?

JamesNewton commented 2 years ago

I am interested in your simulator having this ability as it would be useful for teaching. Like NandGame. But with your nicer user interface.

kazuhikoarase commented 2 years ago

@JamesNewton Where is lacking of user interface?

NewbieXII commented 2 years ago

yeah.. so hard :(... that is why i ask you ? hehehe cause i doing it for a month to do that... i have a idea,,, how about we use can the connector as data finder?... something like this... we just want to know that the device is in the workspace.

"devices":[ ], "connectors":[ ] can we use these two as data finder?...

JamesNewton commented 2 years ago

@kazuhikoarase I'm saying your user interface is better.

NewbieXII commented 2 years ago

i need a condition to know that can tell what inside of the workspace. you know like evaluating what inside of the breadboard. :(