Vestibule Assessment 3/20/19

  1. What is P5? How is it distinguished from Processing?

P5 is a system that run libraries just like JavaScrip to make code more assessable to artist beginners educators etc and it distinguished by making the program more simpler 

2. What does IDE stand for? Describe its components.

Stand for integrated Development Environment and it helps applications with tools like menu bar, project explorer tool box, text editor, etc

3. How do you save a file in the P5 editor? What naming/saving convention might you use? 

On the top left corner we have and option on file tap to save project also I will name it sketch.js as is simpler for programs to run it.

4. What is a library? How do you access and use a library with P5?

Libraries will help us with plug ins such as images, sounds especial canvas like 2d or 3d animations.

5. What do the triangle and circular shapes across the top of the P5 editor represent?

These represent the play animation for the code and to stop it.

6. How do you add and name an additional or new tab in the P5 editor?

On the top of the the processor we will have the option right next to auto save to rename our project

7. Describe the coordinate system in P5.

The system consist in a (X,Y) locations for point and objects to be located on canvas starting form the right top corner with a (0,0) ordination

8. What is the general syntax and structure for a line of code? Use code to demonstrate your response.

function setup() {

9. What is the general syntax and structure for a block of code? Use code to demonstrate your response.

function setup() {

  createCanvas(400, 400);

10. Why are certain words in different colors in the P5 editor?

(r,g,b)

11. What is a system or reserved word in P5? Give an example.

This are words store by the program to used anywhere in the syntax without needing a variable

12. How does order matter in P5?  Give an example demonstrated with code.

Order matter is very important for the sketch to follow the lines and had an outcome. If a line is missing or misplace it could give you and error and change the sockets outcome for example misplacing the background  will cover your objects and leave you with a blank screen.

13. What is the difference between mouseIsPressed and mousePressed()? Use code to demonstrate your response.

function mousePressed() {.   Happen when mouse is fully pressed

if (mouseIsPressed) {   add another function to the statement for a continue loop

14. What called function must always be first in setup()?

CreateCanvas

15. What is the difference between an inline comment and a block or multi-line comment? Use code to demonstrate your response.

/*This lines are ignore by the code*/

// speed = speed * -1;

16. Does whitespace matter in P5? Capitalization? Use code to demonstrate your response.

Variables, Operators, Logic

White space matter to help separate paragraphs of space, tab and line feed that have meaning and make it look neat and not crowder

 Function draw() {

  background(canvBGR, canvBGG, canvBGB);

  stroke(circStroke);

  fill(circR, circG, circB);

  stroke(circStroke);

  ellipse(circX, circY, circSize, circSize);

17. What is a variable? What is a data type? What is a value?

Variable can change depending on conduitons

Data types are arrays, booleans, values

Values are tributes that objects give to get access to indirect access

18. What is the difference between a system variable and one that you define? Use code to demonstrate your response.

Let display.

let R=100

19. What is scope and how does it impact code? Use code to demonstrate your response.

Can be set for a variable

Let a=10

Function setup() {

vreateCanvas(400,400);

Backeround(0);

Streake(255);

noLoop();

}

20. What does it mean to declare, initialize and use a variable? Use code to demonstrate your response.

You declare a value beefier the function and give a value

x=10

y=20

21. What happens when a variable is attempted to be accessed outside of its scope?

Only global variables can be access outside of the scope A variable declared within a block of code has local scope, and is only accessible by other code within the same block

22. What happens when a variable is declared globally, but is not used?

The code will run the other functions

23. What value does var nums; have?

You can declare it as cordinates or color types

24. What are operators in P5? Use code to demonstrate your response using at least one operator.

The logical operators for AND (&&) and OR (||) are used to combine simple relational statements into more complex expressions

If (i<= 70 II I >= 100 {

25. What is a boolean data type?

Is usually has a positle values depending on a true or false statement

26. List three examples of primitive data types.

Boolean, float, string.

27. Write a code example that increments a value by 5.

let recX= 200;

let recY = 130;

let recStroke = 35;

let recCol= 250;

let recSize = 75;

let canvBGR = 0;

let speed = 5;

function setup () {

createCanvas(500,400)

}

function draw() {

 background (canvBGR);

  stroke (recStroke);

  fill(recCol);

  rect(recX, recY, recSize, recSize);

  recX = recX – speed;

if ((recX > height) || (recX < 0)) {

  speed = speed * -1;

  background(10, 240, 10);

}

28. Describe the order of operations for: x = speed * 40;

Let rect

Let speed

Function setup() {

createCanvas(200,200);

Rect = (255);

X=width/2;

y=height/2;

Speed = 40

29. Write a code example that decreases a value by one using shorthand.

let x =10

x=x-5”; 

30. What does the logical operator ! do?

We used else, else if, and, or to create a function stamens that if one doesn’t work try the other one

31. What is an if statement? When should it be used? Use code to describe its syntax.

It references to a stamens that a function should be active when stamens is true is activated it for example    if ((recX > height) || (recX < 0)) {

32. How many if statements can you use? What is an alternative to the if statement?

you can used sevral computer will run to see if the conditionals are tru

33. What is the difference between else and else if? Use code to demonstrate your response.

Activation for one or other Staten depending if it meet the function. You can only used one else after that you should used else if you not computer will take first else.

34. What is the difference between code with several consecutive if statements and code with several else if statements?

Code with run thru all if Staten’s while code with take the first else statement

34. What is the difference between code with several consecutive if statements and code with several else if statements?

Code with run thru all if Staten’s while code with take the first else statement

35. What is a while loop? When should it be used? Use code to describe its syntax.

While can execute any number of times by looping to the text expiresion 

Let x =o

While x<10;

x=x+1

36 What is a for loop? When should it be used? Use code to describe its syntax.

While help to get out of the loop when it gets to 10

x=2

For (let X=0, X<width, X=x+10) 

37. Write code that uses a nested for loop to draw a grid of squares across the x and y axis of a canvas Functions.

38. What is a function? 

Functions help draw and prices add on for specific target when added ousted of setup

39. What is the difference between a function or method built into P5 and one that you define?

Depending if you want to set variables outside or part of the function to create a sketch

40. What does the keyword function mean?

It begging the definition and structor of what your trying to build

41. What does the keyword return mean?

It helps a function to return a value

42. Write code that uses the keyword return.

a=10

b=5

Function multiplytwonumbers(a,b) {

Return result;

}

43. Write code that uses a defined function (by the user) and call or use it.

Function draw() {

Backround(200);

ellipse(10, 20,3040);

}

44. What is the distinction between function and method?

Function is a code that makes and object move while the method is the definition of the object

45. What is the distinction between argument and parameter?

Arguments are the value of the function and the parameter is where the function is going to be in.

46. What do the () in a function call or definition indicate?

Constructor of the class function

47. What will happen if you call an undefined function?

nothing will happen and no errors will be display

48. What will happen if you define a function, but do not call or use it?

nothing will happen just take space.


49. What concept are functions useful for?

 Objects/Classes, Arrays

functions help you create code and simplify it to not take plenty of space like arrays.

50. What is an object?

Objects are variables that discreve a data shape with size color etc

51. What data type is an object?

String,array,class,interface.

52. What concept are objects, classes/constructors and arrays useful for?

this are concepts that are useful for reusability and modularity

53. What is the difference between an object and a class/constructor function? Use code to demonstrate  your response. 

54. What is dot syntax? Use code to demonstrate your response.

This.x

Also help to get into and object functions

55. What is the keyword new used for?

Refere to new objects that may be create or duplicate from

56. What is a constructor? Where and when is it used? Use code to demonstrate your 

response.

Is a block of code that where an object is created.

57. What is the this keyword used for?

It references to this current object

58. Organize original code to include the main program in one tab and a class or constructor in another. Use in-line comments to walkthrough code.

59. What is an array?

is a list of data that can make a whole of objects

60. What notation is used to denote an array?

is a system to store data in close columns brackets

61. How do data types impact arrays?

62. What is an index?

is the position of an item inside an array, a list, or other data structure

63. Write code that declares, initializes and accesses elements in an array. Use comments to walkthrough code.

4 values for this array

Let nums = [100,80,50,20]

Function setup(){

}

Function draw() {

Backeround(0);   color black

rect(100,200,nums[3], nums[3]); rect will have the 20 value

Ellipse (200,200,nums[2],nums[2]); will have 50 value

}

64. List two or three functions that can be called on an array. Describe how they manipulate the array.

Let nums = Can manipulate the locateon variables

Let words = manipulates phrases

Optional, except for Questions 66, 72-78 and 80.

66. What are the keywords let and const? How are they distinct from var?

Workflow

This are keywords to identify variable that could be more curate in the p5 while var is a more classic function used in java.

67. What is a local server and why would one be used?

68. How can you install and run code using a local server?

69. What is Node?

70. What is NPM? Give an example of a module that can be downloaded and installed from NPM.

71. List one text editor that can be used in lieu of an IDE. How can a P5 project be coded and run using

a text editor?

[72. What does CLI stand for?

73. How can the current directory be identified using the command line?

74. How can the contents of a directory (current) be viewed?

75. What command must be used to make a directory or folder using the CLI?

77. How can recent commands be viewed on the command line?

78. What shortcut keyboard combination can be used to automatically complete a path in the 

commands line?

79. How can a local server be started and stopped (state actual commands)?

80. What naming convention can be used to save an application or program?

81. What is GIT?

[82. How does GIT distinct from Github or Bitbucket?

83. What is the command to initialize a GIT repo?

84. What is the difference between staging and committing in GIT?

85. What is the difference between an untracked and tracked file in GIT?

86. What is the difference between the npm init and git init commands?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s