stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 244

Day 244 of 365 · Pro · Month 9: Logistics and greenhouse

Project: sorting plant

A sorting plant with two diverters separates ores, ice and the rest, counts every class and reports a jam when a decision is not carried out.

Project 40 min Week 35

What you learn today

  • Separate ores, ice and the rest
  • Counter per class
  • Report jams

The sorting week ends with the plant that should stand in front of every smelter: everything that comes out of drill and centrifuge ends up in the right place – and you know how much of what.

The plant

DevicePrefabName
sorter in front of the smelterStructureSorter“Weiche1”
sorter in front of the ice crusherStructureSorter“Weiche2”
three LED displaysStructureConsoleLED5“Erze”, “Eis”, “Rest”
wall lightStructureWallLight“Stau”

“Weiche1” sends real ores to output 2 to the smelter, everything else to output 1 on to “Weiche2”. “Weiche2” sends ice to output 2 to the ice crusher, the rest to output 1 into storage.

Counting every item exactly once

The sorter sets Output to −1 after passing an item on – and also after every write of Mode. That is why the chip only writes Mode when it is not already 2. If Output is still at 0 or 1, a decision is waiting to be carried out – then the chip must not see and count the item a second time. That is why it only decides and counts while Output is −1:

lbn tmp SORTER HASH("Weiche1") Output Average
sgez tmp tmp
bnez tmp diverter2

The counters simply add the result of the comparison: add ores ores target counts 1 for an ore, 0 for everything else.

Reporting a jam

A decision that is not carried out for a long time means: the output is full. The same counter trick as for the jam at the output slot measures how long Output has been at 0 or 1. Above 20 ticks “Stau” lights up. The light also shows when “Weiche1” is unreachable.

Milestones

  1. Ores at diverter 1 to the smelter, special cases onwards
  2. Ice at diverter 2 to the ice crusher, rest into storage
  3. Counters per class
  4. An item is not counted twice
  5. Report a jam and a missing diverter
Tip

The counters live in registers and start at 0 after every restart of the chip. For counts across restarts the value belongs in a logic memory – or you read the devices' ExportCount, as next week.

Project task

Task

Build the sorting plant following the description. The chip only writes logic mode when a diverter is not already at Mode 2 – and then does not decide at it in this pass, because the write only clears Output after the tick. At each diverter, decisions and counts only happen when Output is −1 and an item lies in the input slot. “Erze”, “Eis” and “Rest” show the counters. “Stau” lights up when at a diverter Output stays at 0 or 1 for more than 20 ticks or “Weiche1” is missing.

Milestones

  1. Milestone 1: ores to the smelter
  2. Milestone 2: ice and rest
  3. Milestone 3: counters per class
  4. Milestone 4: no double counting
  5. Milestone 5: jam and missing diverter

Hints

Hint 1

Per diverter first check Mode: not LOGIC, then write it once and jump to the next diverter. Then read Output, sgez, jam counter with add/mul, jump on when Output is set.

Hint 2

Diverter 1 as yesterday, plus add ores ores target. Diverter 2: add ice ice target, seqz tmp target, add rest rest tmp.

Hint 3

Jam: max tmp jam1 jam2, sgt with JAM, plus snan on the Mode of diverter 1.

Quiz

2 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed all milestones of the project
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere