<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://www.stuycs.org/apcs-dw/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.stuycs.org/apcs-dw/" rel="alternate" type="text/html" /><updated>2026-09-18T20:05:41+00:00</updated><id>https://www.stuycs.org/apcs-dw/feed.xml</id><title type="html">AP Computer Science A</title><subtitle>Class website for Mr. Dyrland-Weaver&apos;s AP CS A Class</subtitle><entry><title type="html">Work 05: Ride The Lightning</title><link href="https://www.stuycs.org/apcs-dw/2026/09/18/a05.html" rel="alternate" type="text/html" title="Work 05: Ride The Lightning" /><published>2026-09-18T00:00:00+00:00</published><updated>2026-09-18T00:00:00+00:00</updated><id>https://www.stuycs.org/apcs-dw/2026/09/18/a05</id><content type="html" xml:base="https://www.stuycs.org/apcs-dw/2026/09/18/a05.html"><![CDATA[<p>Posted: Fri Sep 18</p>
<h4 id="due-tuesday-922-1000am">Due: Tuesday 9/22 10:00am</h4>
<h4 id="submission-name-w05_lightning">Submission name: w05_lightning</h4>
<!--more-->

<h3 id="important-notes">Important notes:</h3>
<ul>
  <li>On Tuesday, we will have a quiz, the quiz will cover:
    <ul>
      <li>Variable types</li>
      <li>Writing functions</li>
    </ul>
  </li>
</ul>

<p>For this assignment, you may want to refer to:</p>
<ul>
  <li><a href="https://processing.org/reference/while.html">Processing’s documentation for <code class="language-plaintext highlighter-rouge">while</code></a></li>
  <li><a href="https://processing.org/reference/random_.html">Processing’s documentation for <code class="language-plaintext highlighter-rouge">random</code></a>
    <ul>
      <li>It is important to note that <code class="language-plaintext highlighter-rouge">random</code> returns a <code class="language-plaintext highlighter-rouge">float</code>, but <code class="language-plaintext highlighter-rouge">line</code> only works with <code class="language-plaintext highlighter-rouge">int</code> arguments. To convert you can do this: <code class="language-plaintext highlighter-rouge">int(random(0, 10))</code>.</li>
    </ul>
  </li>
</ul>

<p><img src="/apcs-dw/assets/img/a07_lightning.png" alt="lightning" /></p>

<h3 id="make-a-lightning-function">Make a lightning function</h3>
<p>Write <code class="language-plaintext highlighter-rouge">drawLightning</code>:</p>
<ul>
  <li>Use the following function header: <code class="language-plaintext highlighter-rouge">void drawLightning(int x, int y, int numParts)</code></li>
  <li>The function should draw <code class="language-plaintext highlighter-rouge">numParts</code> connected lines starting at <code class="language-plaintext highlighter-rouge">(x, y)</code>.</li>
  <li>Each line should start at the previous <code class="language-plaintext highlighter-rouge">(x, y)</code> coordinates and end at random coordinates with the following restrictions:
    <ul>
      <li>The next x coordinate should be an <code class="language-plaintext highlighter-rouge">int</code> in the range <code class="language-plaintext highlighter-rouge">[x - 5, x + 5)</code>.</li>
      <li>The next y coordinate should add a random <code class="language-plaintext highlighter-rouge">int</code> in the range <code class="language-plaintext highlighter-rouge">[y + 5, y + 20)</code>.</li>
    </ul>
  </li>
  <li>Use a <code class="language-plaintext highlighter-rouge">while</code> loop to draw the appropriate number of lines. Do not worry if your lightning bolt goes past the bottom of the screen or doesn’t make it all the way.</li>
</ul>

<h3 id="write-a-setup-function">Write a <code class="language-plaintext highlighter-rouge">setup</code> function</h3>
<p><code class="language-plaintext highlighter-rouge">setup</code> should:</p>
<ul>
  <li>Set the screen size to 500x500.</li>
  <li>Run <code class="language-plaintext highlighter-rouge">drawLightning</code> at least 5 times.</li>
</ul>

<h3 id="optional-modifications">Optional modifications</h3>
<ul>
  <li>Play around with <code class="language-plaintext highlighter-rouge">stroke</code> and <code class="language-plaintext highlighter-rouge">strokeWeight</code> to make better looking lightning bolts.</li>
  <li>Use <code class="language-plaintext highlighter-rouge">random</code> in conjunction with <code class="language-plaintext highlighter-rouge">stroke</code> and <code class="language-plaintext highlighter-rouge">stokeWeight</code></li>
  <li>Add other features to make the image more interesting.</li>
  <li>If you create an interesting lightning image, save it (as a <code class="language-plaintext highlighter-rouge">png</code> or <code class="language-plaintext highlighter-rouge">jpeg</code>), and share it on piazza, use the tag <code class="language-plaintext highlighter-rouge">nextjourney</code>.</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[Posted: Fri Sep 18 Due: Tuesday 9/22 10:00am Submission name: w05_lightning]]></summary></entry><entry><title type="html">Work 04: Fun With Flags</title><link href="https://www.stuycs.org/apcs-dw/2026/09/17/a04.html" rel="alternate" type="text/html" title="Work 04: Fun With Flags" /><published>2026-09-17T00:00:00+00:00</published><updated>2026-09-17T00:00:00+00:00</updated><id>https://www.stuycs.org/apcs-dw/2026/09/17/a04</id><content type="html" xml:base="https://www.stuycs.org/apcs-dw/2026/09/17/a04.html"><![CDATA[<p>Posted: Thu Sep 17</p>
<h4 id="due-thursday-917-400pm">Due: Thursday 9/17 4:00pm</h4>
<h4 id="submission-name-w04_flag">Submission name: w04_flag</h4>
<!--more-->

<h3 id="make-a-team-flag">Make a team flag!</h3>
<ul>
  <li>Group up with your TableBuddies+™.</li>
  <li>Share your logo program with each other.</li>
  <li>Design a team flag that incorporates the designs from each members logo/avatar/pet from the previous assignment.</li>
  <li>Write a processing program that draws the flag, using the functions your teammates created, adding features as required.</li>
  <li>At this time, only one team member should upload the assignment to their repository. We will deal with code sharing later.</li>
</ul>

<!--
* Until 4pm on Friday, 9/18, everyone will have read access to all class repositories, so you should all have a copy of your team's flag in your own repo.
-->]]></content><author><name></name></author><summary type="html"><![CDATA[Posted: Thu Sep 17 Due: Thursday 9/17 4:00pm Submission name: w04_flag]]></summary></entry><entry><title type="html">Work 03: ‘git your house in order</title><link href="https://www.stuycs.org/apcs-dw/2026/09/15/a03.html" rel="alternate" type="text/html" title="Work 03: ‘git your house in order" /><published>2026-09-15T00:00:00+00:00</published><updated>2026-09-15T00:00:00+00:00</updated><id>https://www.stuycs.org/apcs-dw/2026/09/15/a03</id><content type="html" xml:base="https://www.stuycs.org/apcs-dw/2026/09/15/a03.html"><![CDATA[<p>Posted: Tue Sep 15</p>
<h4 id="due-wednesday-915-1000am">Due: Wednesday 9/15 10:00am</h4>
<h4 id="submission-name-w03_logo">Submission name: w03_logo</h4>
<!--more-->

<h3 id="make-a-logo-function">Make a Logo Function</h3>
<ul>
  <li>Recreate your drawing from Work 02, but turn it into a function.</li>
  <li>“How?” you say? Follow the example below. Tomorrow we will go over what is actually happening.</li>
  <li>You’ll notice <em>submission name</em> at the top of this assignment. From now on, you should save all your programs using that name, exactly. For example, today’s work should be saved as <code class="language-plaintext highlighter-rouge">w03_logo</code>.</li>
</ul>

<h3 id="setup-your-main-work-repository">Setup Your Main Work Repository</h3>
<p><em>This can only be done after I have told you that I’ve created the repositories, I will do this during class</em></p>
<ul>
  <li>Check your GitHub notifications (top-right area next to your gh avatar image) for an invitation to a new repository. The repository will be named <code class="language-plaintext highlighter-rouge">PD-GH_USERNAME-work</code> (e.g. <code class="language-plaintext highlighter-rouge">08-stuydw-work</code>).
    <ul>
      <li>If you don’t see a notification, check your email.</li>
      <li>If you don’t see an email, attempt to visit the repository in your browser, the link will be <code class="language-plaintext highlighter-rouge">https://github.com/apcs-dw/REPO_NAME</code>. replace <code class="language-plaintext highlighter-rouge">REPO_NAME</code> with your repository name.</li>
    </ul>
  </li>
  <li>Upload your processing program to the repository.
    <ul>
      <li>For the moment, do so by selecting <strong>Upload files</strong> under the <strong>Add file</strong> button. You can then drag &amp; drop your program in.</li>
      <li>Processing programs are saved as folders, upload the entire folder.</li>
      <li>If you modify your code at home, you can upload just the <code class="language-plaintext highlighter-rouge">w03_logo.pde</code> file inside the folder. GitHub will overwrite the old file.</li>
    </ul>
  </li>
</ul>

<h3 id="making--using-a-function">Making &amp; Using a Function</h3>
<p>This is a general template you can use for this assignment. Replace the comments with your specific code.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>void setup() {
  size(500, 500);
  //CALL YOUR FUNCTION HERE
}

void drawLogo(int x, int y) {
  //YOUR DRAWING CODE HERE
  //You do not need to declare x and y
  //since they are in the function header.
}
</code></pre></div></div>

<p>As an example, if your logo code looked like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>int x, y, logoSize;
x = 250;
y = 250;
logoSize = 100;

fill(255, 0, 0);
circle(x, y, logoSize);
fill(255);
circle(x, y, logoSize * 0.66);
fill(255, 0, 0);
circle(x, y, logoSize * 0.33);
</code></pre></div></div>

<p>The function version would look like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>void setup() {
  size(500, 500);
  drawLogo(250, 250, 100);
}//end setup

void drawLogo(int x, int y, int logoSize) {
  fill(255, 0, 0);
  circle(x, y, logoSize);
  fill(255);
  circle(x, y, logoSize * 0.66);
  fill(255, 0, 0);
  circle(x, y, logoSize * 0.33);
}//drawLogo
</code></pre></div></div>]]></content><author><name></name></author><summary type="html"><![CDATA[Posted: Tue Sep 15 Due: Wednesday 9/15 10:00am Submission name: w03_logo]]></summary></entry><entry><title type="html">Work 02: Getting to Know Processing</title><link href="https://www.stuycs.org/apcs-dw/2026/09/14/a02.html" rel="alternate" type="text/html" title="Work 02: Getting to Know Processing" /><published>2026-09-14T00:00:00+00:00</published><updated>2026-09-14T00:00:00+00:00</updated><id>https://www.stuycs.org/apcs-dw/2026/09/14/a02</id><content type="html" xml:base="https://www.stuycs.org/apcs-dw/2026/09/14/a02.html"><![CDATA[<p>Posted: Mon Sep 14</p>
<h4 id="due-tuesday-915-1000am">Due: Tuesday 9/15 10:00am</h4>
<!--more-->

<h3 id="make-a-logo">Make a Logo</h3>
<ul>
  <li>Design a logo/avatar/pet. That should fit within a 200x200 pixel area.</li>
  <li>Write a processing program that draws your logo, using variables for all the shapes so that the logo is not anchored to a specific location.</li>
  <li>Make your screen size 500x500 when testing.</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[Posted: Mon Sep 14 Due: Tuesday 9/15 10:00am]]></summary></entry><entry><title type="html">Work 01: Getting to Know Processing</title><link href="https://www.stuycs.org/apcs-dw/2026/09/11/a01.html" rel="alternate" type="text/html" title="Work 01: Getting to Know Processing" /><published>2026-09-11T00:00:00+00:00</published><updated>2026-09-11T00:00:00+00:00</updated><id>https://www.stuycs.org/apcs-dw/2026/09/11/a01</id><content type="html" xml:base="https://www.stuycs.org/apcs-dw/2026/09/11/a01.html"><![CDATA[<p>Posted: Fri Sep 11</p>
<h4 id="due-monday-914-1000am">Due: Monday 9/14 10:00am</h4>
<!--more-->

<h2 id="create-your-first-processing-program">Create Your First Processing Program</h2>
<ul>
  <li>Create a processing program that draws something cool!
    <ul>
      <li>Make liberal use of the <a href="https://processing.org/reference">processing library documentation</a></li>
      <li>I suggest looking at the <a href="https://processing.org/reference/#shape">2d Primitives Section</a>, as well as the <a href="https://processing.org/reference/#color">Setting Color Section</a></li>
    </ul>
  </li>
  <li>Use at least 5 drawing functions.</li>
  <li>Change the fill or stroke color at least once.</li>
  <li>We will discuss how to submit this in class next week. If you want to access this program in class on Monday, you can try creating a repository in GitHub and uploading your program there.
    <ul>
      <li>While not a requirement, it is a good opportunity to investigate GitHub and see what makes/doesn’t make sense so we can have a productive discussion about it on Monday.</li>
    </ul>
  </li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[Posted: Fri Sep 11 Due: Monday 9/14 10:00am]]></summary></entry><entry><title type="html">Work 00: Getting to Know You</title><link href="https://www.stuycs.org/apcs-dw/2026/09/10/a00.html" rel="alternate" type="text/html" title="Work 00: Getting to Know You" /><published>2026-09-10T00:00:00+00:00</published><updated>2026-09-10T00:00:00+00:00</updated><id>https://www.stuycs.org/apcs-dw/2026/09/10/a00</id><content type="html" xml:base="https://www.stuycs.org/apcs-dw/2026/09/10/a00.html"><![CDATA[<p>Posted: Thu Sep 10</p>
<h4 id="due-monday-914-1000am">Due: Monday 9/14 10:00am</h4>
<!--more-->

<ol>
  <li>Please fill out the student info form found here: <a href="https://docs.google.com/forms/d/e/1FAIpQLSdF10VnMPNmH_KYaDKZxT8ZQoZGgTCQMvcxVVK39mUjs-xgaw/viewform?usp=publish-editor">https://docs.google.com/forms/d/e/1FAIpQLSdF10VnMPNmH_KYaDKZxT8ZQoZGgTCQMvcxVVK39mUjs-xgaw/viewform?usp=publish-editor</a></li>
  <li>You will need a <a href="https://github.com/">GitHub</a> account in order to submit work for this class. If you don’t have one already, go to <a href="https://github.com/">https://github.com/</a> and create one.</li>
  <li>Read and acknowledge the <a href="https://docs.google.com/forms/d/e/1FAIpQLSf4OlX8Y6lWBkM7xjJX6kqWeWrL1MGsCQszy36oDPAJyhKyYg/viewform?usp=dialog">Stuyvesant Computer Science Lab and Network Usage Policy</a></li>
</ol>]]></content><author><name></name></author><summary type="html"><![CDATA[Posted: Thu Sep 10 Due: Monday 9/14 10:00am]]></summary></entry></feed>