Posts

Showing posts from October, 2021

week 7

Image
 This week we talked about many concepts on the web. Some of the terms are really new to me, and still trying to figure out. HTML -  HyperText Markup Language the most basic found of building a web. <html> <head> <head/> <body> <body/> <html/> CSS-  Cascading Style Sheets   it is use to stylist the elements in HTML.  DOM-  Document Object Model   how web documents information. I practice input.text in the work sheet; during this, I am wondering is there any ways to change typing? Basically how to make a keyboard, can I change the default of typing?Also how can I put a blank space in my interface just for typing? question from worksheet I think I have the right code, I want the text same with my input value, but it just won't show up in the text when I //the button.mouse.Pressed it is also not working. so I think the problem start at text(Input.value(),10,10) Then I add  function mousePressed, and have submit() under it. The text just show up same

week 6 presentation

Image
 I made a gobang game in P5. I actually did this assignment back to the class about for() loop. I used for()loop to create the checkerboard and pieces, but back then, I had many bugs like my checkerboard always draw over my pieces and hard to make every click. After learning about class and array, the demo that clicked to create multiple bubbles we did in class inspired me to remake a more practical and useable gobang game. In general, I create a class for the piece and use the array to call the piece multiple times. And also used boolean expression to make the pieces are one white one black happened in order.   I make the mouse press function. In lines 45-47, this is where I create a new piece by pressing the mouse. In line 23-24 I gives the coordinate of the x,y and my pieces also are located by this x,y.  In line 26, I provide an if statement for my click; only in an area, the click can show up the piece on the checkerboard. Start from line 28, the boolean expression controls the pi

Week 5

 This week we learning about % on class, which means  it divides a number and returns the remainder to the integer. I have  trouble to understand % at the beginning, but then I am more understand it by Chinese, 0,1 more like just represent two states(可否被整除).   About % is it always be used with for()? I am kind hard to think in what other conditions(except  checkerboard) I can use %. for the concept of set up your own function I think it is more like a clear way to organized our code, and also have clear way to call deferent code by personalized function.  I think one of  my problem is hard code, I think this can be always for me to remind myself to get code as  clear, simple as possible.  I am also thinking if it is possible to have some simple function, that can work by it own, and I can build a library for myself to use in the future. 

week4

Image
In this week's class, we learned how to use for(). And I feel much more explicit about boolean expression and related terms.   The worksheet inspired my assignment; I am trying to make a Gobang(Five In a Row) game. So here is my thinking process: 1. build a checkerboard with a black stroke and yellow background. 2. set up a boolean expression that an ellipse would appear at the checkerboard's cross if my mouse clicked. 3. set another boolean expression to let one click make the ellipse white and the next black.  The hardest part is keeping the piece in the checkboard and changing color in a regular pattern by using Boolean expression. But in the process of making this game, I think there are more problems than I thought. 1. To let the piece stay. After using the boolean expression with the mouse is pressed, my piece only appears when I press the mouse, and it won't stay. So I am thinking of using function mouse pressed, or mouse clicked; I still don't know the differenc