CodingTrain / CodingTrain/Suggestion-Box
p5.js tutorial - advanced arrays (jagged 2d array of objects)
- 主要言語
- 言語のデータがありません
- スター
- 570
- フォーク
- 85
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
A follow up to tutorial 9.12: 2D Arrays in JavaScript
Data doesn't always come in neat 4x7 element packages; sometimes it is irregular. I'm not entirely sure what the represented limits are in p5.js - I believe you can make an array of arrays, but how about when dimensions get jagged? Or an array of jagged arrays of objects?
Consider one example: gift boxes under a Christmas tree.
A box might be represented as an object with several properties -
- recipient
- an array of things inside
You might want to organize them several ways -
the simplest is an array of all boxes, but what if you wanted an array of Senders, and each element of this array contained an array of boxes sent by them.
Would this be possible to represent? How would one enumerate the various arrays, or get the lengths?
What would the syntax be for the length of a Sender list?
If boxes[sender][item] was the syntax for one item, how would one get the number of items from a sender? How would one get the number of senders?
Could this data be extended to include an item name and cost? These things periodically haunt my dreams...
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まずチュートリアル 9.12「2D Arrays in JavaScript」と、この issue で説明されている例を確認します。ジャグ配列、オブジェクトの配列、ネストされたインデックス指定、コレクションの長さの取得を扱う高度なチュートリアルの範囲を定義します。チュートリアルが、提案されたギフトボックスのデータ構造とそれに関する質問を明確に説明し、実演できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100