問題タブ [hash-reference]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
perl - キーを知らなくても、ハッシュのネストされたハッシュを反復処理するにはどうすればよいですか?
ハッシュのハッシュ、つまり、データ構造にハッシュとハッシュ参照があります。メインのハッシュ名しかなく、最も深いハッシュのキーがない場合、最も深いハッシュを繰り返し処理できますか?
名前が %gates_info で、「nand」や「and」などのキーがない場合、ハッシュ全体を反復処理したいと考えています。私が達成しようとしているのは、並べ替えによって各ゲートで最大の数値を取得することです。nand ケースでは 3、and ケースでは 2 などです。サブ max_gate_order は、ソートして最大値を返すために使用されます。ありがとう