-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bea5241
commit 6bfc822
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from canal.cyclone import * | ||
|
||
num_tracks = 5 | ||
|
||
input_nodes = {} | ||
for side in SwitchBoxSide: | ||
input_nodes[side] = [] | ||
for track in range(num_tracks): | ||
input_nodes[side].append(SwitchBoxNode(0, 0, track, 16, side, SwitchBoxIO.SB_IN)) | ||
|
||
output_nodes = {} | ||
for side in SwitchBoxSide: | ||
output_nodes[side] = [] | ||
for track in range(num_tracks): | ||
output_nodes[side].append(SwitchBoxNode(0, 0, track, 16, side, SwitchBoxIO.SB_OUT)) | ||
|
||
for track in range(num_tracks): | ||
for side_from in SwitchBoxSide: | ||
for side_to in SwitchBoxSide: | ||
if side_from == side_to: | ||
continue | ||
input_node = input_nodes[side_from][track] | ||
output_node = output_nodes[side_to][track] | ||
print(f"Wire {input_node} -> {output_node}") | ||
input_node.add_edge(output_node) |