Author Archives: Mr. M

Rock Paper Scissors [Alice 2]

Rock, Paper Scissor Game

We are going to create a Rock, Paper, Scissors game using Alice loops and if/else ‘s

  1. 1.Add a “rock”, “paper” and “scissors” objects to screen and enlarge them all to approximately the same size:rock-paper-scissors
  2. Make a Boolean variable called gamePlaying  and set its initial value to true : gamePlayingBoolean

3.Add a while loop based on gamePlaying

while loop

4. Make a variable called cpuChoice.   cpuChoice  is a number This variable will represent what the computer randomly chooses (rock, paper or scissors)

5. Use the world function that generates a random number so that the random number is an integer between 1 and 3 , inclusive.

alice-world-genare-random

Store the return value of that random number generator into cpuChoice  at the beginning of the loop

alice-random-range-

6. Debugging has many meanings. Experienced developers build debugging and logging into the development of their programs from the start.

  • We are going to do that in Alice by “watching” the cpuChoice variable

7. Right click on cpuChoice  and select watch this variable

alice-watch-variable

8 .Now we have the computer randomly choosing either 1,2, or 3 and these numbers will represent rock, paper and scissors respectively

So, what do you think we should do next?

Lesson continued here

rps__1

 

 

Ethics Business Topics

Assignment:

Become an expert on your topic. Explain

  1. any unethical acts
  2.  what laws, if any , were broken
  3. what government agency was involved
  4.  what consequences did that party (person or business) suffer

Format: Powerpoint

Foxconn [Sweatshop]

Martin Shkreli [Pharma Bro]

Vokswagon Emissions Scandal

Valeant drug scandal

Enron

Wlls Fargo Checking Scandal

link

Zenefits Insurance Scandal

 

AutoZone [discrimination]

 

PayDay Loans

 

 

Mad Libs 1 [Python]

Taken from https://teals-introcs.gitbooks.io/2nd-semester-introduction-to-computer-science-pri/units/1_unit/06_lesson/project.html

Overview: Using Python, students will use variables, input, and printing to create a Mad Lib. You will also practice designing a project by planning out your Mad Lib before implementing it. Part of the project is to use your creativity to design your own unique story.

The program will print out the title of the Mad Libs story, as well as a short explanation of game play

The program should then prompt the user to enter in nouns, verbs, adjectives, proper nouns, and adverbs

mad_libs_screen_shot

Implementation Details

Plan out your story on pencil and paper first, before you start implementing the program.

  • Create your story
  • Select the missing words
  • Determine each words part of speech
  • Create introduction
  • Create questions
  • Divide story into print statements

As mentioned above the program must request words from the user. The following must be included in the program:

  • 10 different words inputted
  • Variable names should correspond to the part of speech requested and part of the story they belong to (e.g. noun1verb2, etc)
  • You may only use 3 print statements to tell your story

Scheme/Rubric

Functional Correctness(Behavior)
Program greets user and explains rules 3
Program accurately requests 10 words (1 for word, 1 for correct request) 20
Program prints full Mad Lib 10
Program exhibits creativity 3
Sub total 35
Technical Correctness
Program utilizes variable names to convey meaning 5
Correct order of inputted words 10
Only 3 print statements 10
Sub total 25
Total 60

 

Math Expressions in Alice

Alice Supports many types of Math Operations.

 

For instance, let’s say that we have the variable someNumber  and it has a value of 2

alice-math_1

What if we want to multiply 2  by  0.5 ?

 

  1. click on the down arrow next to “2” and select “math”

alice-math_2

2) select “2*”  which means “2 times ”

alice-math_2

3) Select “Other” for the second number “b”

alice-math_3B

4) The calculator appears so you can  choose 5

 

5)  Select “5”

alice-math-calculator

6) Viola: You know have a math expression that represents 2 * 5

alice-math-4

 

8) Now let’s make a variable called “divisor” and then divide this expression by that

alice-math-5

9) Select the down arrow

alice-math-6

10) select as shown:

alice-math-7

 

11) Viola :

alice-math-8

 

 

 

Alice 2 : Asking User for Input

The world object has many, many useful functions including a way to ask the user for information—say  a number, a name or something.

  1.  Click on world
  2.  click on functions
  3. scroll down ot the ask user functions (See Diagram 1 ) and read below for more
Diagram 1

Diagram 1

 

Animated Gif showing the whole process of asking user for a number and then saying that number (using what as a String)

 

what-as-a-number-optiimized

Intro to CS [2018-19]

Unit 4 . Parameters and Objects [advanced] 

  • Complete Packets:
    • #18 Writing a Class Level Method
    • #20 Saving an Object to a New Class
    • #21 Stepwise Refinement (Follow the instructions carefully on this one). If your method does not seem to work, it’s probably because you switched a left leg with a right leg
    • #22 Passing Arguments
    • Assignments here 

 Unit 4 . Loops

  • Complete Packets:
    • 15 b (The Loop Instruction)
    • 16 (The While Instruction)
  • Assignments here

 


 

Unit 3 Datatypes and if/else

 

Unit 2

  • Complete packets #9-10  
    • #9 (variables)
    • #10 functions vs methods
    • Drag Racing
    • Spaceship Repair
    • Apollo 15
    • End of Unit Assign

Assignments and Quiz topics


Unit 1

  • Complete packets #3- 8  by Thursday Wednesday 27th
    • #1 (Example tutorial)
    • #2 (skipped)
    • #3 Coach–opacity, color
    • #4 Camera and manipulating objects (turn,tumble etc)
    • #5a Alice code (how to add instructions)
    • #5b  Alice Primitive Methods
    • #6 ( camelCase,  — read only, no tutorials)
    • #7 ( primitive methods from object tree)
    • #8 (do together )
  • Project #1
    • at least 10 instructions
    • modify a ‘subpart’
    • 1 do-together statement
    • at least 3 different objects
    • Worth 7 points.
    • To get a 7/7 you must achieve the ‘wow factor’–ie go above and beyond to create a superior final project
    • you must save your file in the format of
      • lastname-assignment1
      • morris-assignment1
  • Eventual Quiz 1 
    • binary number systems (see dropbox notes for review)
    • converting from various bases to base 10(see Google drive notes for review)
    • comment vs instruction in alice

 

 

 

 

 

Last year’s 

 

Web Design Programming 18-19

Supa Web

Phaser.io resources and links

 

 

Unit 4 Bootstrap 4

  • Class PPT’s on bs4
  • Bootstrap 4 documentation
  • Bootstrap 4 @ www
  • Download the bs4  (unzip this then copy contents of the “dist” folder to a “bs4/” folder in your project (https://getbootstrap.com/docs/4.1/getting-started/contents/#css-files)
  • cdn paths : https://www.bootstrapcdn.com

    •  
  • Colors (bg-danger, text-success etc..)

Unit 3 Jquery

 

Unit 2 Javascript

 

Unit

Mr M Assignment (reproduce the screenshots in the powerpoint)

 

 

Useful Links

 

Useful Websites