| | 1 | [wiki:Documentation] |
| | 2 | | !printNodeSet |
| | 3 | |
| | 4 | = Print Node Set = |
| | 5 | |
| | 6 | Displays all nodes in the node set as a grid |
| | 7 | |
| | 8 | Usage |
| | 9 | {{{ |
| | 10 | joeuser@console.sb1:~$ ./printNodeSet nodeset |
| | 11 | Y |
| | 12 | 20 ************........ |
| | 13 | 19 **.*********........ |
| | 14 | 18 ************........ |
| | 15 | 17 *************....... |
| | 16 | 16 *************....... |
| | 17 | 15 *************....... |
| | 18 | 14 *********.***....... |
| | 19 | 13 *************....... |
| | 20 | 12 *************....... |
| | 21 | 11 *.***********....... |
| | 22 | 10 *************....... |
| | 23 | 9 *************....... |
| | 24 | 8 *****.*******....... |
| | 25 | 7 *************....... |
| | 26 | 6 *************....... |
| | 27 | 5 *************....... |
| | 28 | 4 *************....... |
| | 29 | 3 *************....... |
| | 30 | 2 *************....... |
| | 31 | 1 ***.*****.***....... |
| | 32 | X 12345678901234567890 |
| | 33 | 1 2 |
| | 34 | }}} |
| | 35 | |
| | 36 | |
| | 37 | Source |
| | 38 | {{{ |
| | 39 | #!/usr/bin/ruby |
| | 40 | require 'orbit_Support' |
| | 41 | |
| | 42 | puts "Y" |
| | 43 | ons = OrbitNodeSets.new(ARGV[0]) |
| | 44 | for y in 1..20 |
| | 45 | output = "#{21-y} " |
| | 46 | output = output + " " if (21-y).to_s.length == 1 |
| | 47 | for x in 1..20 |
| | 48 | |
| | 49 | if ons.isNodeSelected(x,21-y) then |
| | 50 | output = output + "*" |
| | 51 | else |
| | 52 | output = output + "." |
| | 53 | end |
| | 54 | end |
| | 55 | puts output |
| | 56 | |
| | 57 | end |
| | 58 | puts " X 12345678901234567890" |
| | 59 | puts " 1 2" |
| | 60 | }}} |