KOHCTPYKTOP Experimental Sandbox

Your browser does not support the HTML5 canvas tag.
::
Your browser does not support the HTML5 canvas tag.
::
Your browser does not support the HTML5 canvas tag.
Your browser does not support the HTML5 canvas tag.
Limit:
Your browser does not support the HTML5 canvas tag.
Name: Type: Color: Name: Type: Color:
Name: Type: Color: Name: Type: Color:
Name: Type: Color: Name: Type: Color:
Name: Type: Color: Name: Type: Color:
Name: Type: Color: Name: Type: Color:
Name: Type: Color: Name: Type: Color:
::
Design Score: 0
Paste the code into the text-area box ⬆ and click import to load it... ➡
::
Generated link will be displayed here... You can store or share it with a friend.
Simulation run speed
Cycle(s) per Frame.
Frames(s) per Second.
Design storage
Update date when replacing design
::

KOHCTPYKTOP: Introduction

Welcome, Comrade, to KOHCTPYKTOP: ENGINEER OF THE PEOPLE.

As a design engineer at Semiconductor Factory H3, your job is to construct the circuits described in the design specifications provided to you and have them pass a verification test.

Each circuit has up to eight signals which will be either inputs or outputs. In verification, a series of input signals will be run against your design; to pass the test, the output from your circuit must closely match the expected outputs provided and receive a score of 97% or above.

DiagramIn the left is part of a timing diagram that shows two inputs, A0 and B0, and an output Y0, that was taken from the KT221A DUAL 2-INOUT AND GATE specifications. To pass this verification, Y0 must be high if and only if both A0 and B0 are also high, as shown in the diagram.

KOHCTPYKTOP: Building circuits

Creation of an NPN gate

In the left is part of a timing diagram that shows two inputs, A0 and B0, and an output Y0, that was taken from the KT221A DUAL 2-INOUT AND GATE specifications. To pass this verification, Y0 must be high if and only if both A0 and B0 are also high, as shown in the diagram.

Circuits are built out of silicon, metal, vias and gates, which are all created by "drawing" them on the circuit grid.

Silicon comes in two variants, N, which is red, and P, which is yellow. Each will conduct signal and can be connected to the metal layer through the use of vias. By drawing a line of one type of silicon and then drawing an overlapping, perpendicular line of the other type you can create a gate; drawing P over N creates an NPN gate (shown left) which will conduct only when the P connection is "hot", while drawing N over P creates a PNP gate that conducts only when the N connection is not "hot".

Metal conducts but is isolated from the silicon layer, connecting to it only at via locations.

KOHCTPYKTOP: Simulation

A few details about the simulation:

In each cycle of the simulation, values from input signals and dedicated voltage sources (labeled +VCC) are propagated across the entire circuit. Based on whether a gate's activation criterion is met, each gate then stores whether or not is should conduct, a value that is used during the NEXT CYCLE of the simulation.

Thus, activating a gate in one cycle will determine its state in the next, allowing for the construction of stateful and complicated circuits.

This also leads to a real-life phenomenon called "propagation delay", whereby the use of many gates in series leads to lag in parts of the circuit that are down stream, which can cause problems due to de-synchonization of stages.

Sandbox: Extra features

This app includes the following improvements over KOHCTPYKTOP:

  • Customize pins by name, type and color
  • Setup pins to generate and/or match patterns
  • Drag selection box turns green if dropping is allowed
  • Copy & Paste selection
  • Rotate or flip selection
  • Undo and redo history (up to 100 mistakes)
  • Improved simulator graph with colorful logic lines and LED
  • Storing and loading designs & snippets in browser's local storage
  • Share your design with a custom link

What is not included in the experimental sandbox:

  • Challenge levels from original game (the user is free to remake them)
  • Story from original game (i'm not going to spoil the ending either...)
  • Music (... why?? You can't run a media player together with your browser?)

Sandbox: Custom patterns

Custom patterns can consist of a starting pattern and a looping pattern.

In order for the pin to use a custom pattern the pin-type must be any of the 3 in "Custom" group:
. G.I.Only - Generate input
. G.I.Show - Generate input and show preview
. G.C.Only - Generate input (clock type)
. G.C.Show - Generate input and show preview (clock type)
. G.I.Match - Generate input and matching pattern
. G.O.Match - Show matching pattern (acts as "Output")

Patterns are formed with multiple characters commands, generating the expected signal; e.g. 01010 generate a signal with positive logic at 2nd and 4th period.

Non-looping custom patterns will have the last logic assigned at the end; e.g. 01 will generate one negative period at the start and a positive signal infinitelly.

Looping custom patterns can be built with a loop marker (vertical line character), starting pattern is optional; e.g. 00|01 will generate two negative periods at the start and periodic down-up-down-up signal toward infinite.

Any character that doesn't match any code below will be ignored.

Logic commands

0 / n / - - "cold" signal (floating)
1 / p / + - "hot" signal (+VCC)
x - Toggle last logic (1xx == 101)
s - Spike (1 on first cycle and 0 for the remaining)
z - Inverted spike (0 on first cycle and 1 for the remaining)
? / r - Random (will be static after generation)

Clock commands

c - Clock (1 for first half and 0 for last half)
k - Inverted clock (0 for first half and 1 for last half)
NOTE: make sure length is divisible by 2.

Length commands

Default length is 10, changing length will affect future commands.
t5. / L5. - Change length 1 to 999 (e.g. t20.01 == 0011)
w5. - Wait cycles 1 to 999 (e.g. 1w20.0 = 1110)
m - Minimum length (set length to 1)
h - Half-period length (set length to 5)
f - Full-period length (set length to 10)
; - Terminate (can be omitted)
NOTE: Always postfix the amount with an unused non-number character (whitespace will also works!).

Looping command

| - Loop marker command (vertical line character)
NOTE: only use one marker, all markers after the 1st one will be ignored.

Sandbox: Hotkeys

Mouse

Left Button - Paint / Select
Middle Button - (Not used)
Right Button - Erase

During selection, right clicking can be used to clear selection box or cancel dragging.

Any tool

0 to 7 - Change tool
Shift - Alternative tool (while holding)
Ctrl+Z - Undo
Ctrl+Y - Redo

Having "No Tool" selected allow the user to not accidentally modify anything in the design by mistake.

Select Tool only

Ctrl+A - Select all
Ctrl+C - Copy selection
Ctrl+X - Cut selection
Ctrl+V - Paste selection
DEL - Delete selection

Select Tool or while dragging

H - Flip horizontally
V - Flip vertically
I - Silicon invert
T - Transpose
R - Rotate clockwise
E - Rotate anti-clockwise

Sandbox: F.A.Q

Q: How do I import/export snippets? Dragging the selection outside the grid doesn't work!
A: Sandbox works differently. You must use the buttons under Snippets tab to store the snippet and double clicking in the snippet list to load it. Additionally you can use the internal clipboard to quickly store/load while editing!

Q: How to draw stuff in specifications?
A: You can't. But since it uses monospaced font you can do some ASCII art, be creative! ;)

Q: Simulation runs too slow!
A: Go to Options tab and under Simulation run speed change your simulation speed, note that faster settings requires a faster PC.

Q: How do I share my design to a friend?
A: Go to Share Designs tab and click Generate Link, copy the provided link and give it to your friend.

Q: How do I share a snippet to a friend?
A: Sadly there's no feature for that. All you can do is create a blank design, paste your snippet and share the design.

Q: I have 2 designs but I want to combine some stuff between, what should i do?
A: You can run another instance of the Sandbox in another browser tab. Copy & paste works across instances!

Q: Can I resize the circuit grid or create a big grid?
A: No, that should make the design incompatible with the main game.

Q: What about adding a 2nd metal layer or more pins? I'm thinking of other features too...
A: See above answer.

Credits

This sandbox is based and inspired of the following game:
KOHCTPYKTOP: Engineer of the people by Zachtronics

KOHCTPYKTOP Experimental Sandbox was coded by JustBurner

This work originated from reverse-engineering the original game and trying to make it 100% compatible, plus adding new features over it.

Contents not related to the sandbox such as story and level challenges are not included here but the user can create designs similar to the challenges if so desires.

... also this sandbox (such like the original game) is completely FREE!

:: Original KOHCTPYKTOP game by Zachtronics, KOHCTPYKTOP Experimental Sandbox by JustBurner :: v1.01 ::