Punchcard Reader: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 9: | Line 9: | ||
|- | |- | ||
! Name !! Type !! Read/Write !! Description | ! Name !! Type !! Read/Write !! Description | ||
|- | |||
|<code>uniqueId</code> | |||
|<code>integer</code> | |||
|READ | |||
|A unique numeric ID tied to this peripheral device, generated on block placement and persistent across restarts. | |||
|- | |- | ||
| <code>hasCardInReader</code> || <code>boolean</code> || READ || Returns whether a punchcard is located in the reader slot. | | <code>hasCardInReader</code> || <code>boolean</code> || READ || Returns whether a punchcard is located in the reader slot. | ||
Latest revision as of 02:08, 7 September 2026

Besides the Punchcard Machine, this is the second block needed for using punch cards. It is capable of reading the Punchcard that is currently in the reader-slot (see the image below). It is also capable of shifting items from right-to-left in the 'Input slots' row, then into the 'Reader slot' and then left-to-right into and in the 'Output slots' row.

Provided component
This block provides the punchcardReader component, offering the following properties:
| Name | Type | Read/Write | Description |
|---|---|---|---|
uniqueId
|
integer
|
READ | A unique numeric ID tied to this peripheral device, generated on block placement and persistent across restarts. |
hasCardInReader |
boolean |
READ | Returns whether a punchcard is located in the reader slot. |
unreadCardCnt
|
integer
|
READ | Returns how many punchcards are located in the top Input slot row, excluding the reader slot. |
freeOutSlotCnt
|
integer
|
READ | Returns how many slots of the Output slots are empty, excluding the reader slot. |
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
:read(shiftCards:boolean) |
String |
| ||||||
:shift() |
boolean |
Shifts any existing card in the reader slot down into the output slots and shifts those to the right. Then shifts the input slots to the left, attempting to put a punchcard into the reader slot. Returns whether the inventory was modified. |