Daniel Gagnon’s Final Project Number Guessing Game Widget By: Daniel Gagnon.

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

I.T Voluntary Blog Week 3 Self assessment. I am looking at my plans (fishbone, mindmap) to make sure that I am on track= 0 I never really look back at.
The Hi-Lo Game by Trevor.  Through code and the process, I learned that this code is very basic. The structure of the code is not that long.
While Loops. Challenge: ● Ask the user a simple math questions ● Continue asking the question until the user gets it right.
Tonight’s JavaScript Topics 1 Conditional Statements: if and switch The Array Object Looping Statements: for, while and do-while.
Python Magic Select a Lesson: Why Learn to Code? Basic Python Syntax
Introduction to a Programming Environment
’10 Pearls of Wisdom’ or some of the main things I have learnt over past 2 years relating to geography Jane Evans.
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
PROGRAMMING In Lesson 5. RECAP  Complete the starter activity.
Real Madrid C.F By: Daniel Grosscup. Why Real Madrid? O My Grandfather introduced the team to me at a Young age and it has been important to me since.
Lecture 15 Practice & exploration Subfunctions: Functions within functions “Guessing Game”: A hands-on exercise in evolutionary design © 2007 Daniel Valentine.
Meet Samuel de Champlain I bet you all think Jacques Cartier is pretty cool for discovering the St. Lawrence River, don’t ya? Well guess what? He isn’t.
Francelette’s Kindness Adventure Card Game. I. Special Rules for different difficulties I. Beginning players to Expert Players II. Being a referee for.
Jim Vetrone, Ph.D. Science Teacher- Hinsdale Central High Scientist- Argonne National Lab Science parent- 3 kids in the district
Computer Bugs Original Powerpoint By: Spring LIS4480 Coding Team Jon.
Partner Study Exciting Exponents!
MOM! Phineas and Ferb are … Aims:
Sometimes we can tell how people are feeling by looking at them. How are they feeling?
Level 2 IT Users Qualification – Unit 1 Improving Productivity Chris.
Topic 11.  The material in this topic is tested any time you do a lab or calculation.  It is extremely important that you follow the rules explained.
Math Games Compiled By: Joan Bartlett and Heather Bartlett.
When you start a new world, pick a backgrou nd.. Click on add objects to add objects to your world.
Slide 11-1 Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Understanding Randomness.
Problem of the Day  Why are manhole covers round?
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
Ever wanted to create an outstanding science fair project ? These slides will help you to achieve this goal.
Understanding Randomness
Everything you need to know to successfully use THE SCIENTIFIC METHOD.
Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally.
30/10/ Iteration Loops Do While (condition is true) … Loop.
Making Decisions uCode: October Review What are the differences between: o BlueJ o Java Computer objects represent some thing or idea in the real.
Control Structures II Repetition (Loops). Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1.
Code reading skills LEVEL GAME.  Skeleton has error messages.  Notice the red lines on right slider. Click… you’ll go to an error.  pieces = levels.getPieces();
By: Cameron Sherwood Daytonian Raceway. My game’s social issue is Breast Cancer. Every question you get right, $10 pretends to go to the cancer awareness.
The Need for Computers Patricia Ellis December 8, 2005 Mrs. Fernandez.
Python 101 Dr. Bernard Chen University of Central Arkansas PyArkansas.
Conditional Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Conditional Statements.  Quiz  Hand in your jQuery exercises from last lecture  They don't have to be 100% perfect to get full credit  They do have.
Decision Structures, String Comparison, Nested Structures
COP 3275 – Iteration and loops Instructor: Diego Rivera-Gutierrez.
Random UNPREDICTABLE NUMBERS. A FEW APPLICATIONS THAT USE RANDOM…. Predictions for life expectance used in insurance Business simulations Games (Give.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Iteration. Iteration: Review  If you wanted to display all the numbers from 1 to 1000, you wouldn’t want to do this, would you? Start display 1 display.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Science app review By Dana Tuuri. App name: painless chemistry challenge.
1 Chapter 11 Understanding Randomness. 2 Why Be Random? What is it about chance outcomes being random that makes random selection seem fair? Two things:
Remember! Say the sentence in the past tense.. I am strong. I was strong.
Statistics 11 Understanding Randomness. Example If you had a coin from someone, that they said ended up heads more often than tails, how would you test.
Conditionals.
Slide 1 Chapter 4 The If…Then Statement  Conditional control structure, also called a decision structure  Executes a set of statements when a condition.
Don’t Worry, Be Happy By: Kendra Nuttall, Grecia Corona, & Avenly Millar.
How To Get To The Amusement Park! By Kelly Fitzgerald How To Get to the Amusement Park! By Kelly Fitzgerald.
Using Gardner’s Multiple Intelligences to Strengthen Reading Lessons By Sarah Schwartz.
FOP: Multi-Screen Apps
What to do when a test fails
IF statements.
Let's Race! Typing on the Home Row
Reflections on the Meaningful Product
Decision Structures, String Comparison, Nested Structures
flow charts and system diagrams
Introduction to TouchDevelop
The first number is posted telling what random number was selected, I did this for testing purposes, in the real thing it would not be there. Since the.
How can you make a guessing game?
How can you make a guessing game?
This shows running the first guess number program which only allows one guess - I show the correct answer for testing purposes.
Software Development Techniques
Presentation transcript:

Daniel Gagnon’s Final Project Number Guessing Game Widget By: Daniel Gagnon

Number Guessing Game Widget This is a Widget program that was created to be a game. The program first picks a random number between 0 and 50. The player then tries to guess that number in the fewest number of tries. The program gives the player hints every time a number is guessed. After the correct number is guessed, the program tells the player how many tries it took. This is a Widget program that was created to be a game. The program first picks a random number between 0 and 50. The player then tries to guess that number in the fewest number of tries. The program gives the player hints every time a number is guessed. After the correct number is guessed, the program tells the player how many tries it took.

Interesting parts of code Random Number Generator Random Number Generator var number = random(0,50); var number = random(0,50); This line of code creates a varaible “number” and the actual random number. This code is important beacasuse it is the most important part of the game. If there were no random number the player would not have to guess to get the correct number. This line of code creates a varaible “number” and the actual random number. This code is important beacasuse it is the most important part of the game. If there were no random number the player would not have to guess to get the correct number.

Interesting Code cont. Counter Counter var counter; var counter;counter=0;counter++ The first line of code creates a variable that will be used as a counter. The second line of code sets the counter to zero. The third line of code adds one to the counter every time the function is run. This code is important becasuse it lets the player of the game know how many tries it took them to guess the correct number. The first line of code creates a variable that will be used as a counter. The second line of code sets the counter to zero. The third line of code adds one to the counter every time the function is run. This code is important becasuse it lets the player of the game know how many tries it took them to guess the correct number.

Interesting Code cont. Interworking of the Game Interworking of the Game function tryNumber(theNumber) { function tryNumber(theNumber) { if (the_number.data <number) alert("Guess Higher"); else if (the_number.data > number) alert("Guess Lower"); } This is part of the function that runs the game. The first line establishes the function and the name of the function. The second line determines if the number the player guesses is less than the random number generated, while the third line determines if the player guesses greater than the random number. This function allows the program to tell the player if they need to guess a higher or lower number. This is part of the function that runs the game. The first line establishes the function and the name of the function. The second line determines if the number the player guesses is less than the random number generated, while the third line determines if the player guesses greater than the random number. This function allows the program to tell the player if they need to guess a higher or lower number.

What I Learned As the programmer of this game I learned that it is actually not too difficult to design a program and execute it as long as you have a drawn up plan. I made a drawing of how I wanted the program to look and work and then wrote it. This helped me a great deal. As the programmer of this game I learned that it is actually not too difficult to design a program and execute it as long as you have a drawn up plan. I made a drawing of how I wanted the program to look and work and then wrote it. This helped me a great deal. I first wrote this game to work on a website and not as a widget. This was a mistake. It is better to write the program only once and not have to rewrite it and figure everything out twice. I first wrote this game to work on a website and not as a widget. This was a mistake. It is better to write the program only once and not have to rewrite it and figure everything out twice. I also learned that a random number generator is a powerful tool and can be used for many applications. I also learned that a random number generator is a powerful tool and can be used for many applications.

Difficulties One of the difficulties that I ran into while creating this project was trying to create a function that helped the user determine if the number they guessed was too high or too low. I overcame this problem by trial and error. I tried different if, else if, and else statements until I figured out what worked and what didn’t. One of the difficulties that I ran into while creating this project was trying to create a function that helped the user determine if the number they guessed was too high or too low. I overcame this problem by trial and error. I tried different if, else if, and else statements until I figured out what worked and what didn’t. Another difficulity I had was trying to change my original program that I wrote for this project into a widget. I found that even though widgets use JavaScript you cannot just cut and paste your code into the widget. There is much more involved. Another difficulity I had was trying to change my original program that I wrote for this project into a widget. I found that even though widgets use JavaScript you cannot just cut and paste your code into the widget. There is much more involved.

Great Discoveries I don’t feel that I made any real new great discoveries for JavaScript or Widgets, but I do feel that I discovered Random Number Generators by myself. I don’t think we covered any random numbers in class so I felt accomplishment when I got my random number generator to work correctly with my game. I don’t feel that I made any real new great discoveries for JavaScript or Widgets, but I do feel that I discovered Random Number Generators by myself. I don’t think we covered any random numbers in class so I felt accomplishment when I got my random number generator to work correctly with my game.

Conclusion This project taught me a lot about programming. I learned how to set a goal for what I wanted my program to look like and do and I went and did it. I found that trial and error in programming is basically the only way to finalize a project to be sure it works 100% correctly. This project was challenging and fun for me and I felt I learned a lot for my first programming class. This project taught me a lot about programming. I learned how to set a goal for what I wanted my program to look like and do and I went and did it. I found that trial and error in programming is basically the only way to finalize a project to be sure it works 100% correctly. This project was challenging and fun for me and I felt I learned a lot for my first programming class.

Program and Slide Show Created by: Daniel Gagnon