• KJ Ha

Pair Code Assignment

Partner: Young Choi

Link to p5.js web editor: https://editor.p5js.org/kh1785/sketches/E_GVozBby



Our first idea was to make a simple sentence game with randomized elements. For a visual effect, we decided to use rollover with fade.


There is a total of five rectangles aligned vertically. Except for the rectangle on the top, which acts as a master monitor, each rectangle is assigned to an array of words. Each array has the words of different parts of speech: first array-nouns and pronouns functioning as a subject, second array-verbs functioning as a predicate, third array-adjectives functioning as a modifier, and forth array-nouns functioning as an objective. Depending on the mouse location, the words in the array are constantly shuffling in random order. Those randomly created sentences, therefore, may seem grammatically correct but they may have meanings that do not quite make sense.


In terms of visual effects, depending on the mouse location, a different rectangle is set to zero brightness making the shuffling invisible (since the color of the text is also zero brightness). When the mouse leaves the rectangle, the color of it changes back to the initial state with a fading effect. Shuffling of the words is visualized on the top rectangle and to print the sentences, one just needs to press the mouse.


Here are the examples of the sentences:


apple loves lonely apples he loves doubtful students apple finds terrible students he finds doubtful days that girl despises lonely days Mimi loves marvelous students apple misses marvelous apples he misses marvelous days Mimi sees marvelous apples he despises terrible apples




© 2020 Kyungjoo Ha. All Rights Reserved