Skip to content

Commit

Permalink
add recipes for solar panel + calculator
Browse files Browse the repository at this point in the history
As described in
#26 (comment)

`calculator` device provides `arith` capability.
  • Loading branch information
byorgey committed Jun 4, 2022
1 parent e1245cb commit dc86a8b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
13 changes: 12 additions & 1 deletion data/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
- name: plasma cutter
display:
attr: device
char: '+'
char: '*'
description:
- "A plasma cutter uses a jet of hot plasma to cut through metal like
butter. Used via the 'salvage' command to cut apart old robots."
Expand Down Expand Up @@ -564,3 +564,14 @@
uses the 'log' command)."
properties: [portable]
capabilities: [log]

- name: calculator
display:
attr: device
char: '+'
description:
- "A calculator allows a robot to do basic arithmetic calculations:
addition, subtraction, multiplication, division, and
exponentiation."
properties: [portable]
capabilities: [arith]
14 changes: 14 additions & 0 deletions data/recipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@
required:
- [1, furnace]

- in:
- [1, glass]
- [8, copper wire]
out:
- [1, solar panel]
required:
- [1, 3D printer]

- in:
- [1, counter]
- [1, solar panel]
out:
- [1, calculator]

- in:
- [32, gear]
- [6, copper wire]
Expand Down
12 changes: 6 additions & 6 deletions src/Swarm/Language/Capability.hs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ constCaps =
Salvage -> [CSalvage]
Reprogram -> [CReprogram]
Drill -> [CDrill]
Neg -> [CArith]
Add -> [CArith]
Sub -> [CArith]
Mul -> [CArith]
Div -> [CArith]
Exp -> [CArith]
-- Some God-like sensing abilities.
As -> [CGod]
-- String operations, which for now are enabled by CLog
Expand All @@ -277,7 +283,6 @@ constCaps =
Appear -> [CAppear] -- paint?
Whereami -> [CSenseloc] -- GPS?
Random -> [CRandom] -- randomness device (with bitcoins)?
Neg -> [CArith] -- ALU? pocket calculator?
Whoami -> [CWhoami] -- mirror, needs a recipe

-- comparator?
Expand All @@ -289,11 +294,6 @@ constCaps =
Geq -> [CCompare]
And -> []
Or -> []
Add -> [CArith]
Sub -> [CArith]
Mul -> [CArith]
Div -> [CArith]
Exp -> [CArith]
-- Some more constants which *ought* to have their own capability but
-- currently don't.
Say -> []
Expand Down

0 comments on commit dc86a8b

Please sign in to comment.