Punchcard Reader: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[File:Punchcard Reader.png|alt=Punchcard Reader block|thumb|Punchcard Reader block]] | [[File:Punchcard Reader.png|alt=Punchcard Reader block|thumb|Punchcard Reader block]] | ||
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. | 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. | ||
[[File:Punchcard_Reader_GUI.png|alt=Punchcard Reader GUI|frame]] | [[File:Punchcard_Reader_GUI.png|alt=Punchcard Reader GUI|frame|none|Punchcard Reader GUI]] | ||
== Provided component == | == Provided component == | ||
| Line 22: | Line 22: | ||
|Returns how many slots of the Output slots are empty, excluding the reader slot. | |Returns how many slots of the Output slots are empty, excluding the reader slot. | ||
|} | |} | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 28: | Line 30: | ||
! Name !! Type !! Description | ! Name !! Type !! Description | ||
|- | |- | ||
| style="white-space: nowrap;" | <code>:read(shiftCards:boolean)</code> || <code>String</code> || | | style="white-space: nowrap;" | <code>:read(shiftCards:boolean)</code> || <code>String</code> || style="padding:0;"| | ||
{| class="wikitable" style="margin:0;" | |||
|- | |||
! shiftCards !! Action | |||
|- | |||
| <code>false</code> || Returns the contents of the card in the reader slot, or errors if none exists | |||
|- | |||
| <code>true</code> || Shifts the cards downwards if reader slot is empty, then performs a regular read, then shifts again. If a card was already in the slot, the initial shift is skipped | |||
|- | |||
|} | |||
|- | |- | ||
| style="white-space: nowrap;" | <code>:shift()</code> || <code>boolean</code>|| 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'''. | | style="white-space: nowrap;" | <code>:shift()</code> || <code>boolean</code>|| 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'''. | ||
|} | |} | ||
{{Navbox content}} | {{Navbox content}} | ||
Latest revision as of 17:26, 1 August 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 |
|---|---|---|---|
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. |