CS61A Lecture 15 Object-Oriented Programming, Mutable Data

Total Page:16

File Type:pdf, Size:1020Kb

CS61A Lecture 15 Object-Oriented Programming, Mutable Data 7/16/2012 COMPUTER SCIENCE IN THE NEWS CS61A Lecture 15 Object‐Oriented Programming, Mutable Data Structures Jom Magrotker UC Berkeley EECS July 12, 2012 http://www.iospress.nl/ios_news/music‐to‐my‐eyes‐device‐converting‐images‐into‐music‐helps‐individuals‐ without‐vision‐reach‐for‐objects‐in‐space/ 2 TODAY REVIEW: BOUND METHODS • Review: Inheritance A method is bound to an instance. Use the increase_hp method defined … with self being the … and amount • Polymorphism for objects of the Pokemon class… ashs_pikachu object … being 150. • Mutable Lists Pokemon.increase_hp(ashs_pikachu, 150) is equivalent to ashs_pikachu.increase_hp(150) Use the increase_hp method of (or bound to) the … with amount ashs_pikachu object… being 150. 3 4 REVIEW: INHERITANCE REVIEW: INHERITANCE We would like to have different kinds of Pokémon, Occasionally, we find that many abstract data besides the “Normal” Pokemon (like Togepi) which types are related. differ (among other things) in the amount of points lost by its opponent during an attack. For example, there are many different kinds of people, but all of them have similar methods of The only method that changes is attack. All the eating and sleeping. other methods remain the same. Can we avoid duplicating code for each of the different kinds? 5 6 1 7/16/2012 REVIEW: INHERITANCE REVIEW: INHERITANCE Key OOP Idea: Classes can inherit methods and Key OOP Idea: Classes can inherit methods and instance variables from other classes. instance variables from other classes. class WaterPokemon(Pokemon): class WaterPokemon(Pokemon): def attack(self, other): def attack(self, other): other.decrease_hp(75) other.decrease_hp(75) class ElectricPokemon(Pokemon): class ElectricPokemon(Pokemon): def attack(self, other): def attack(self, other): other.decrease_hp(60) other.decrease_hp(60) 7 8 REVIEW: INHERITANCE REVIEW: INHERITANCE Key OOP Idea: Classes can inherit methods and instance variables from other classes. >>> ashs_squirtle = WaterPokemon(‘Squirtle’, ‘Ash’, 314) class WaterPokemon(Pokemon): >>> mistys_togepi = Pokemon(‘Togepi’, ‘Misty’, 245) def attack(self, other): >>> mistys_togepi.attack(ashs_squirtle) other.decrease_hp(75) >>> ashs_squirtle.get_hit_pts() 264 class ElectricPokemon(Pokemon): >>> ashs_squirtle.attack(mistys_togepi) def attack(self, other): >>> mistys_togepi.get_hit_pts() other.decrease_hp(60) 170 9 10 REVIEW: INHERITANCE REVIEW: INHERITANCE >>> ashs_squirtle = WaterPokemon(‘Squirtle’, >>> ashs_squirtle = WaterPokemon(‘Squirtle’, ‘Ash’, 314) ‘Ash’, 314) >>> mistys_togepi = Pokemon(‘Togepi’, ‘Misty’, 245) >>> mistys_togepi = Pokemon(‘Togepi’, ‘Misty’, 245) >>> mistys_togepi.attack(ashs_squirtle) >>> mistys_togepi.attack(ashs_squirtle) >>> ashs_squirtle.get_hit_pts() mistys_togepi >>> ashs_squirtle.get_hit_pts() uses the attack 264 method from the 264 >>> ashs_squirtle.attack(mistys_togepi) Pokemon class. >>> ashs_squirtle.attack(mistys_togepi) >>> mistys_togepi.get_hit_pts() >>> mistys_togepi.get_hit_pts() ashs_squirtle 170 170 uses the attack method from the WaterPokemon class. 11 12 2 7/16/2012 REVIEW: INHERITANCE REVIEW: INHERITANCE >>> ashs_squirtle = WaterPokemon(‘Squirtle’, If the class of an object has the method or attribute of ‘Ash’, 314) interest, that particular method or attribute is used. >>> mistys_togepi = Pokemon(‘Togepi’, ‘Misty’, 245) >>> mistys_togepi.attack(ashs_squirtle) Otherwise, the method or attribute of its parent is used. >>> ashs_squirtle.get_hit_pts() 264 >>> ashs_squirtle.attack(mistys_togepi) Inheritance can be many levels deep. >>> mistys_togepi.get_hit_pts() If the parent class does not have the method or attribute, 170 we check the parent of the parent class, and so on. 13 14 REVIEW: INHERITANCE REVIEW: INHERITANCE We can also both override a parent’s method or attribute and use the original parent’s method. class ElectricPokemon(Pokemon): ... Say that we want to modify the attacks of Electric Pokémon: when they attack another def attack(self, other): Pokémon, the other Pokémon loses the original Pokemon.attack(self, other) 50 HP, but the Electric Pokémon gets an increase self.increase_hp(10) of 10 HP. 15 16 PROPERTIES PROPERTIES One way is to define a new method. Python allows us to create attributes that are computed from other attributes, but need not class Pokemon: necessarily be instance variables. ... def complete_name(self): Say we want each Pokemon object to say its return self.owner + “’s ” + self.name complete name, constructed from its owner’s name and its own name. >>> ashs_pikachu.complete_name() ‘Ash’s Pikachu’ 17 18 3 7/16/2012 PROPERTIES ANNOUNCEMENTS Another way is to use the property decorator. • Project 2 is due Friday, July 13. • Homework 7 is due Saturday, July 14. class Pokemon: ... • Project 3 will be released this weekend, due @property Tuesday, July 24. def complete_name(self): • Your TA will distribute your graded midterms return self.owner + “’s ” + self.name in exchange for a completed survey. >>> ashs_pikachu.complete_name ‘Ash’s Pikachu’ 19 20 WHAT IS YOUR TYPE? POLYMORPHISM Write the method attack_all for the Pokemon class that takes a tuple of OOP enables us to easily make new abstract data Pokemon objects as its argument. When called on a Pokemon object, that types for different types of data. Pokémon will attack each of the Pokémon in the provided tuple. (Ignore the output printed by the attack method.) >>> type(ashs_pikachu) >>> ashs_pikachu = ElectricPokemon(‘Pikachu’, ‘Ash’, 300) <class ‘ElectricPokemon’> >>> ashs_squirtle = WaterPokemon(‘Squirtle’, ‘Ash’, 314) >>> mistys_togepi = Pokemon(‘Togepi’, ‘Misty’, 245) >>> type(ashs_squirtle) >>> mistys_togepi.attack_all((ashs_pikachu, ashs_squirtle)) <class ‘WaterPokemon’> >>> ashs_pikachu.get_hit_pts() 250 >>> type(mistys_togepi) is Pokemon >>> ashs_squirtle.get_hit_pts() True 264 21 22 POLYMORPHISM POLYMORPHISM for other in others: self.attack(other) class Pokemon: ... other can be an object of many different data def attack_all(self, others): types: ElectricPokemon, WaterPokemon, for other in others: and Pokemon, for example. self.attack(other) 23 24 4 7/16/2012 POLYMORPHISM POLYMORPHISM for other in others: Write the method attacked_by for the Pokemon class that takes a tuple of self.attack(other) Pokemon objects as its argument. When called on a Pokemon object, that Pokémon will be attacked by each of the Pokémon in the provided tuple. attack can work on objects of many >>> ashs_pikachu = ElectricPokemon(‘Pikachu’, ‘Ash’, 300) different data types, without having to >>> ashs_squirtle = WaterPokemon(‘Squirtle’, ‘Ash’, 314) consider each data type separately. >>> mistys_togepi = Pokemon(‘Togepi’, ‘Misty’, 245) >>> ashs_squirtle.attacked_by((ashs_pikachu, mistys_togepi)) >>> ashs_squirtle.get_hit_pts() attack is polymorphic. 204 25 26 POLYMORPHISM POLYMORPHISM for other in others: other.attack(self) class Pokemon: ... other can be an object of many different data def attacked_by(self, others): types: ElectricPokemon, WaterPokemon, and Pokemon, for example. for other in others: other.attack(self) It can also be an object of any other class that has an attack method. 27 28 POLYMORPHISM POLYMORPHISM: HOW DOES + WORK? Key OOP idea: The same method can work on We try the type function on other expressions: data of different types. >>> type(9001) <class ‘int’> We have seen a polymorphic function before: >>> type(‘hello world’) >>> 3 + 4 <class ‘str’> 7 >>> type(3.0) >>> ‘hello’ + ‘ world’ <class ‘float’> ‘hello world’ 29 http://diaryofamadgayman.files.wordpress.com/2012/01/wait‐what.jpg 30 5 7/16/2012 POLYMORPHISM: HOW DOES + WORK? EVERYTHING IS AN OBJECT The dir function shows the attributes of a class: Everything (even numbers and strings) >>> dir(WaterPokemon) in Python is an object. ['__class__', '__delattr__', '__dict__', ..., 'attack', 'decrease_hp', 'get_hit_pts', 'get_name', 'get_owner', 'increase_hp', 'total_pokemon'] In particular, every class (int, str, The green attributes were defined inside (and inherited from) the Pokemon class and the blue attribute was defined directly Pokemon, ...) is a subclass of a built‐in inside the WaterPokemon class. object class. Where did the red attributes come from? 31 32 EVERYTHING IS AN OBJECT EVERYTHING IS AN OBJECT The object class provides extra attributes that Since everything is an object, this means we enable polymorphic operators like + to work on should be able to call methods on everything, many different forms of data. including numbers: >>> dir(object) ['__class__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', >>> 3 + 4 '__getattribute__', '__gt__', '__hash__', 7 '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', >>> (3).__add__(4) '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] 7 33 34 EVERYTHING IS AN OBJECT EVERYTHING IS AN OBJECT Python converts the expression Python converts the expression 3 + 4 ‘hello’ + ‘ world’ to to (3).__add__(4) (‘hello’).__add__(‘ world’) 3 is an int object. The int class has an ‘hello’ is a str The str class also has a __add__ method. object. different __add__ method. 35 36 6 7/16/2012 EVERYTHING IS AN OBJECT EVERYTHING IS AN OBJECT If a class has an __add__ method, we can use the + Implement the method __gt__ for the Pokemon operator on two objects of the class. class that will allow us to check if one Pokémon is “greater” than another, which means that it has Similarly, for example, (strictly) more HP than the other. 4 > 3 is converted to (4).__gt__(3) >>> ashs_pikachu = ElectricPokemon(‘Pikachu’, 4 <= 3 is converted
Recommended publications
  • KJ Episodes up to Date and Can FINALLY Start on Episode 13! I Know, I Know
    Episode Twelve: The Squirtle Squad A Twisted Version Of Pokémon Episode 12 A colourful group of clothing made their way down the dirt road path. Ash happily marched with a wide smile on his face. His throat vibrated a gleeful signature tune known to the world of Pokémon. Daisy followed her brother's lead, the two siblings humming harmonically. Kelly stood in the back of the group adorning her typical black/gray/gray-blue headphones that blared music just barely audible for those who stood around her. Strangely enough, her usual little jig was missing from her walk; instead, her head was staring down at the ground. A slight frown curved her lips, displaying a wariness to the ground. Mistico tilted her head, noticing her friend looked awfully cautious. "Kelly, are you, like, okay? You totally seem upset about something?" she asked. Kelly nodded. "I'm fine. I'm just a bit scared about falling down another hole." SNAP The colour drained from Kelly's face, looking forward at Ash's foot. Brock and Misty dispersed to the side of him and Daisy walking in front of him, looking at the hole Ash's foot was suddenly in. After a pause, another loud snap opened another gaping hole in the ground. Possibly the fifth one they had fell into that day! They tumbled into the ditch, squishing each other awkwardly. It had been a few days since Ash had caught his Charmander. His confidence was on a high rise, catching (or rather befriended) two Pokémon only a few days apart from each other.
    [Show full text]
  • All Fired Up
    All Fired Up Adapted by Jennifer Johnson Scholastic Inc. 5507167_Text_v1.indd07167_Text_v1.indd v 112/20/172/20/17 66:50:50 PPMM If you purchased this book without a cover, you should be aware that this book is stolen property. It was reported as “unsold and destroyed” to the publisher, and neither the author nor the publisher has received any payment for this “stripped book.” © 2018 The Pokémon Company International. © 1997–2018 Nintendo, Creatures, GAME FREAK, TV Tokyo, ShoPro, JR Kikaku. TM, ® Nintendo. All rights reserved. Published by Scholastic Inc., Publishers since 1920. SCHOLASTIC and associated logos are trademarks and/or registered trademarks of Scholastic Inc. The publisher does not have any control over and does not assume any responsibility for author or third-party websites or their content. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission of the publisher. For information regarding permission, write to Scholastic Inc., Attention: Permissions Department, 557 Broadway, New York, NY 10012. This book is a work of fi ction. Names, characters, places, and incidents are either the product of the author’s imagination or are used fi ctitiously, and any resemblance to actual persons, living or dead, business establishments, events, or locales is entirely coincidental. ISBN 978-1-338-28409-6 10 9 8 7 6 5 4 3 2 1 18 19 20 21 22 Printed in the U.S.A. 40 First printing 2018 5507167_Text_v1.indd07167_Text_v1.indd iviv 112/20/172/20/17 66:50:50 PPMM 1 The Charicifi c Valley “I have fought so many battles here in the Johto region,” Ash Ketchum complained.
    [Show full text]
  • Zenkaikon 2012 Press
    Zenkaikon 2012 Press Kit Page 1 of 9 Event Overview Description Zenkaikon, an annual convention celebrating Japanese animation (anime), comics (manga), and pop culture, is returning to the Philadelphia area for its sixth annual event. It features a variety of programming including anime and live action screenings, educational panels, workshops, costume competitions, concerts by musical guests, martial arts demonstrations, video and table- top gaming, vendors, artists and more. Guests include voice actor Sonny Strait (Fullmetal Alchemist, DragonBall Z), voice actress Michele Knotz (Pokemon, The World of Narue), anime rock band The Asterplace, steamgoth band Platform One, comedian Uncle Yo, author CJ Henderson, Kyo Daiko taiko drummers, the PA Jedi, Samurai Dan & Jillian, and others. www.zenkaikon.com Location Greater Philadelphia Expo Center at Oaks 100 Station Avenue Oaks, PA 19456 Dates Friday, May 11, 2012, 3 p.m. to 2 a.m. Saturday, May 12, 2012, 9 a.m. to 2 a.m. Cost $30 at the door Contact Kristyn Souder Head of Communications (267) 536-9566 [email protected] Page 2 of 9 Background History Zenkaikon was founded in 2006 by the merging of two local events, Kosaikon – an anime convention held at Villanova University – and Zentrancon – an anime and science fiction convention held on the University of Pennsylvania campus. Kosaikon held its first event in 2003, where 75 individuals came together to celebrate their interest in Japanese animation. Zentrancon's debut convention took place in October 2005, when 350 people came to Philadelphia to watch anime and science fiction screenings, meet celebrity guests, and participate in video gaming.
    [Show full text]
  • If You Purchased This Book Without a Cover, You Should Be Aware That This Book Is Stolen Property. It Was Reported As “Unsold
    If you purchased this book without a cover, you should be aware that this book is stolen property. It was reported as “unsold and destroyed” to the publisher, and neither the author nor the publisher has received any payment for this “stripped book.” ©2017 The Pokémon Company International. ©1997-2017 Nintendo, Creatures, GAME FREAK, TV Tokyo, ShoPro, JR Kikaku. TM, ® Nintendo. All rights reserved. Published by Scholastic Inc., Publishers since 1920. SCHOLASTIC and associated logos are trademarks and/or registered trademarks of Scholastic Inc. The publisher does not have any control over and does not assume any responsibility for author or third-party websites or their content. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission of the publisher. For information regarding permission, write to Scholastic Inc., Attention: Permissions Department, 557 Broadway, New York, NY 10012. This book is a work of fi ction. Names, characters, places, and incidents are either the product of the author’s imagination or are used fi ctitiously, and any resemblance to actual persons, living or dead, business establishments, events, or locales is entirely coincidental. ISBN 978-1-338-17591-2 10 9 8 7 6 5 4 3 2 1 17 18 19 20 21 Printed in the U.S.A. 40 First printing 2017 4475378_Text_v1.indd75378_Text_v1.indd iviv 111/2/161/2/16 11:04:04 PMPM Talent Showdown Adapted by Tracey West Scholastic Inc. 4475378_Text_v1.indd75378_Text_v1.indd v 111/2/161/2/16 11:04:04 PMPM 1 Gary, Again! “This town sure is crowded,” Ash Ketchum said.
    [Show full text]
  • A Real Pizazzy OVERTURE Culminates with a Vaudeville Entrance for the TWO MOVERS
    A New Musical Book by Michael Slade Music and Lyrics by John Siegler and John Loeffler, Norman J. Grossfeld, Louis Cortelezzi, Ken Cummings, Neil Jason, Bob Mayo and Michael Whalen Cueing Script by: Arturro Porrazi and Chris Mitchell Posted with Permission on: http://www.pocketmonsters.net/ FINAL VERSION - 10/6/00 Pokémon Live! – 10/6/00 Page 2 CHARACTERS: The Humans: ASH MISTY BROCK JESSIE JAMES GIOVANNI MRS. KETCHUM PROFESSOR OAK NURSE JOY (NATALIE) OFFICER JENNY (SUZANNE) TRAINER A (SINCLAIR) TRAINER B (JAKE) TRAINER C (SHAUN) DEAF TRAINER (JESSE) GIRL TRAINER 1 (NATALIE) GIRL TRAINER 2 (SUZANNE) GIRL TRAINER 3 (ABBEY) PRETTY GIRL (ABBEY) HENCHMEN (Five Men, Five Women) BACK-UP SINGERS TRAINERS The Pokémon: PIKACHU JIGGLYPUFF MEOWTH MEWTWO MECHA-MEW2 VENUSAUR ALAKAZAM LAPRAS ELECTRODE Others: DEXTER THE DEXTEXTTES SONGS: ACT ONE POKÉMON THEME: Chorus POKÉMON THEME (reprise): Chorus, Ash YOU AND ME AND POKÉMON: Ash, Misty, Brock, Pikachu, Chorus IT WILL ALL BE MINE: Giovanni, Jessie, James, Henchmen MY BEST FRIENDS: Ash, Misty, Brock EVERYTHING CHANGES: Professor Oak, Mrs. Ketchum, Trainers, Pokémon EVERYTHING CHANGES (rep): Giovanni JIGGLYPUFF SONG: Jigglypuff MISTY'S SONG: Misty, Pokémon BEST AT BEING THE WORST: Meowth, Jessie, James PIKACHU!: Ash and Entire Company ACT TWO KIND OF POKÉMON R U?: Dexter, Dextettes THE TIME HAS COME: Ash YOU&ME&POKÉMON (Reprise): Giovanni DOUBLE TROUBLE: Jessie, James, Meowth DOUBLE TROUBLE (reprise): Jessie, James, Meowth TWO PERFECT GIRLS: Brock, Back-up Singers I'VE GOT A SECRET Mrs. Ketchum, Misty, Ash EVERYTHING CHANGES (Reprise): Mrs. Ketchum YOU JUST CAN'T WIN: (Giovanni, Ash) FINALÉ (REPRISE): Company Pokémon Live! – 10/6/00 Page 3 ACT ONE – SCENE 1 In the darkness we hear the opening strains of the POKÉMON THEME.
    [Show full text]
  • Pikachu's Global Adventure
    Pikachus Global Adventure Joseph Tobin In the last years of the last millennium, a new consumer phenomenon devel- oped in Japan and swept across the globe. Pokémon, which began life as a piece of software to be played on Nintendo’s Game Boy (a hand-held gaming computer), quickly diversified into a comic book, a television show, a movie, trading cards, stickers, small toys, and ancillary products such as backpacks and T-shirts. Entering into production and licensing agreements with Japanese com- panies including GameFreak, Creatures, Inc., Shogakukan Comics, and TV To- kyo, and with companies abroad including their wholly owned subsidiary, Nintendo of America, Wizards of the Coast (now a division of Hasbro), 4Kids Entertainment and the Warner Brothers Network, Nintendo created a set of inter- related products that dominated children’s consumption from approximately 1996 to 2000. Pokémon is the most successful computer game ever made, the top globally selling trading card game of all time, one of the most successful child- ren’s television programs ever broadcast, the top grossing movie ever released in Japan, and among the five top earners in the history of films worldwide. At Pokémon’s height of popularity, Nintendo executives were optimistic that they had a product, like Barbie and Lego, that would sell forever, and that, like Mickey Mouse and Donald Duck, would become enduring icons worldwide. But by the end of 2000, Pokémon fever had subsided in Japan and the United States, even as the products were still being launched in such countries as Brazil, Italy, and Israel. As I write this article, Pokémon’s control of shelf- space and consumer consciousness seems to be declining, most dramatically in Japan and the United States.
    [Show full text]
  • Hidden Fates Card List Use the Check Boxes Below to Keep Track of Your Pokémon TCG Cards!
    Pokémon TCG: Hidden Fates Card List Use the check boxes below to keep track of your Pokémon TCG cards! = standard set = parallel set ● = common ★ = rare ★U = rare Ultra ★R = rare Rainbow ★SH = rare Shiny = standard set foil = Shiny Vault foil ◆ = uncommon ★H = rare Holo = rare Holo GX ★S = rare Secret SH = rare Shiny GX 1 Caterpie ● 19 Pikachu ● 37 Cubone ● 55 Brock’s Training ★H 2 Metapod ◆ 20 Raichu-GX 38 Clefairy ● 56 Erika’s Hospitality ★ 3 Butterfree ★ 21 Voltorb ● 39 Clefairy ● 57 Giovanni’s Exile ◆ 4 Paras ● 22 Electrode ★ 40 Clefable ★ 58 Jessie & James ★H 5 Scyther ◆ 23 Jolteon ★ 41 Jigglypuff ● 59 Koga’s Trap ◆ 6 Pinsir-GX 24 Zapdos ★H 42 Wigglytuff-GX 60 Lt. Surge’s Strategy ◆ 7 Charmander ● 25 Ekans ● 43 Mr. Mime ★ 61 Misty’s Cerulean City Gym ◆ 8 Charmeleon ◆ 26 Ekans ● 44 Moltres & Zapdos & Articuno-GX 62 Misty’s Determination ◆ 9 Charizard-GX 27 Arbok ★ 45 Farfetch’d ◆ 63 Misty’s Water Command ★H 10 Magmar ◆ 28 Koffing ● 46 Chansey ◆ 64 Pokémon Center Lady ◆ 11 Psyduck ● 29 Weezing ★ 47 Kangaskhan ★ 65 Sabrina’s Suggestion ◆ 12 Slowpoke ● 30 Jynx ◆ 48 Eevee ★H 66 Moltres & Zapdos & Articuno-GX ★U 13 Staryu ● 31 Mewtwo-GX 49 Eevee ● 67 Giovanni’s Exile ★U 14 Starmie-GX 32 Mew ★ 50 Snorlax ★ 68 Jessie & James ★U 15 Magikarp ● 33 Geodude ● 51 Bill’s Analysis ★ 69 Moltres & Zapdos & Articuno-GX ★R 16 Gyarados-GX 34 Graveler ◆ 52 Blaine’s Last Stand ★ 17 Lapras ★ 35 Golem ★ 53 Brock’s Grit ◆ 18 Vaporeon ★H 36 Onix-GX 54 Brock’s Pewter City Gym ◆ SV1 Scyther ★SH SV25 Zorua ★SH SV49 Charizard-GX SH SV73 Kartana-GX SH SV2 Rowlet
    [Show full text]
  • If You Purchased This Book Without a Cover, You Should Be Aware That This Book Is Stolen Property
    If you purchased this book without a cover, you should be aware that this book is stolen property. It was reported as “unsold and destroyed” to the publisher, and neither the author nor the publisher has received any payment for this “stripped book.” ©2017 The Pokémon Company International. ©1997-2017 Nintendo, Creatures, GAME FREAK, TV Tokyo, ShoPro, JR Kikaku. TM, ® Nintendo. All rights reserved. Published by Scholastic Inc., Publishers since 1920. SCHOLASTIC and associated logos are trademarks and/or registered trademarks of Scholastic Inc. The publisher does not have any control over and does not assume any responsibility for author or third-party websites or their content. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission of the publisher. For information regarding permission, write to Scholastic Inc., Attention: Permissions Department, 557 Broadway, New York, NY 10012. This book is a work of fi ction. Names, characters, places, and incidents are either the product of the author’s imagination or are used fi ctitiously, and any resemblance to actual persons, living or dead, business establishments, events, or locales is entirely coincidental. ISBN 978-1-338-17585-1 10 9 8 7 6 5 4 3 2 1 17 18 19 20 21 Printed in the U.S.A. 40 First printing 2017 4475381_TXT_v1.indd75381_TXT_v1.indd iviv 111/8/161/8/16 55:39:39 PMPM Race to Danger Adapted by Tracey West Scholastic Inc. 4475381_TXT_v1.indd75381_TXT_v1.indd v 111/8/161/8/16 55:39:39 PMPM 1 An Angry Challenge “What’s over that hill?” Ash Ketchum wondered.
    [Show full text]
  • Pokemon Diamond and Pearl Set Checklist
    Pokemon Diamond And Pearl Set Checklist Eunuchoid Yves unreeving some commandery and speechifies his gopherwood so compliantly! Unseeing and unallied Levi snugs her caddis cumbers while Ewan shreddings some mountain shabbily. Zincy Erick still dialyzes: hagioscopic and ashiest Enrique damnifying quite malignly but sate her hatchers exquisitely. What used to do they feature all textures, who is an island until you and class list of red games? All FIFA players are and in real database. Indonesian idol audition was called best shiny dratini is here! The checklist whether you can. Get diamond pearl. The second promotional set, called Best of challenge, was also released by Wizards of beautiful Coast. We have to pokemon diamond and pearl fan nation digital producer pat who. Each month and pearl versions seven more interested in diamond, contact info collection in this day packages to stats in buena vista, pearl and pokemon diamond, as a horse caught. Fine print free fire red e mais populares jogos friv. Super cool are not respond in herself and. Steve with water to its symbol to support is important to get to shutdown due out ahead for much higher score. The end of pokemon sprites of pokemon and. Enjoy their full siblings of Pokemon TCG printable checklists. Other name for checklist and pokemon pearl hockey name ideas about printable board a french door refrigerator that. Got taken in english set checklist sinnoh pokédex by pubg continental or setting. They load the appearance of a top foil, form are only printed in down one version. Artbook atelier series in a banner as well, checklist and pokemon pearl set up trick room? Diamond color Card List Prices Collection Management.
    [Show full text]
  • Young Ash Go West
    Go West, Young Ash Adapted by Tracey West Scholastic Inc. 5505053_Text_v1.indd05053_Text_v1.indd v 111/27/171/27/17 99:40:40 PPMM If you purchased this book without a cover, you should be aware that this book is stolen property. It was reported as “unsold and destroyed” to the publisher, and neither the author nor the publisher has received any payment for this “stripped book.” © 2018 The Pokémon Company International. © 1997–2018 Nintendo, Creatures, GAME FREAK, TV Tokyo, ShoPro, JR Kikaku. TM, ® Nintendo. All rights reserved. Published by Scholastic Inc., Publishers since 1920. SCHOLASTIC and associated logos are trademarks and/or registered trademarks of Scholastic Inc. The publisher does not have any control over and does not assume any responsibility for author or third-party websites or their content. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission of the publisher. For information regarding permission, write to Scholastic Inc., Attention: Permissions Department, 557 Broadway, New York, NY 10012. This book is a work of fi ction. Names, characters, places, and incidents are either the product of the author’s imagination or are used fi ctitiously, and any resemblance to actual persons, living or dead, business establishments, events, or locales is entirely coincidental. ISBN 978-1-338-28402-7 10 9 8 7 6 5 4 3 2 1 18 19 20 21 22 Printed in the U.S.A. 40 First printing 2018 5505053_Text_v1.indd05053_Text_v1.indd iviv 111/27/171/27/17 99:40:40 PPMM 1 Pikachu vs.
    [Show full text]
  • Sm12 Web Cardlist En.Pdf
    1 Venusaur & Snivy-GX 61 Black Kyurem ★H 121 Crabrawler ● 181 Stufful ● 2 Oddish ● 62 Wishiwashi ★H 122 Crabominable ★ 182 Bewear ★ 3 Gloom ◆ 63 Wishiwashi-GX 123 Rockruff ● 183 Type: Null ◆ 4 Vileplume-GX 64 Dewpider ● 124 Lycanroc ★H 184 Silvally-GX 5 Tangela ● 65 Araquanid ◆ 125 Passimian ● 185 Beastite ◆ 6 Tangrowth ◆ 66 Pikachu ● 126 Sandygast ● 186 Bellelba & Brycen-Man ◆ 7 Sunkern ● 67 Raichu ★ 127 Palossand ★ 187 Chaotic Swell ◆ 8 Sunflora ★ 68 Magnemite ● 128 Alolan Meowth ● 188 Clay ◆ 9 Heracross ◆ 69 Magneton ★H 129 Alolan Persian-GX 189 Cynthia & Caitlin ◆ 10 Lileep ◆ 70 Jolteon ◆ 130 Alolan Grimer ● 190 Dragonium Z: Dragon Claw ◆ 11 Cradily ★ 71 Chinchou ● 131 Alolan Muk ★ 191 Erika ◆ 12 Tropius ◆ 72 Lanturn ★ 132 Carvanha ● 192 Great Catcher ◆ 13 Kricketot ● 73 Togedemaru ◆ 133 Absol ◆ 193 Guzma & Hala ◆ 14 Kricketune ◆ 74 Togedemaru ● 134 Pawniard ● 194 Island Challenge Amulet ◆ 15 Deerling ● 75 Solgaleo & Lunala-GX 135 Bisharp ◆ 195 Lana’s Fishing Rod ◆ 16 Sawsbuck ★H 76 Koffing ● 136 Guzzlord ★H 196 Lillie’s Full Force ◆ 17 Rowlet ● 77 Weezing ★ 137 Alolan Sandshrew ● 197 Lillie’s Poké Doll ◆ 18 Rowlet ● 78 Natu ● 138 Alolan Sandslash ★ 198 Mallow & Lana ◆ 19 Dartrix ◆ 79 Xatu ★ 139 Steelix ★H 199 Misty & Lorelei ◆ 20 Decidueye ★H 80 Ralts ● 140 Mawile ◆ 200 N’s Resolve ◆ 21 Buzzwole ★H 81 Kirlia ◆ 141 Probopass ◆ 201 Professor Oak’s Setup ◆ 22 Charizard & Braixen-GX 82 Gallade ★H 142 Solgaleo ★H 202 Red & Blue ◆ 23 Ponyta ● 83 Duskull ● 143 Togepi & Cleffa & Igglybuff-GX 203 Roller Skater ◆ 24 Rapidash ◆ 84 Dusclops
    [Show full text]
  • Inheritance and Polymorphism OOP Inheritance Inheritance Inheritance
    3/26/15 OOP • Object-oriented programming is another paradigm that makes objects its central Inheritance and Polymorphism players, not funcEons. • Objects are pieces of data and the associated behavior. (with Pokemon) • Classes define an object, and can inherit methods and instance variables from each other. 2 Inheritance Inheritance Occasionally, we find that many abstract data We would like to have different kinds of Pokémon, types are related. which differ (among other things) in the amount of points lost by its opponent during an aack. For example, there are many different kinds of The only method that changes is attack. All the people, but all of them have similar methods of other methods remain the same. Can we avoid eang and sleeping. duplica0ng code for each of the different kinds? 3 4 Inheritance Inheritance Key OOP Idea: Classes can inherit methods and Key OOP Idea: Classes can inherit methods and instance variables from other classes instance variables from other classes public class WaterPokemon extends Pokemon public class WaterPokemon extends Pokemon { { … … void attack(Pokemon other) void attack(Pokemon other) The Pokemon class is the superclass of the { { class. other.decrease_hp(75); other.decrease_hp(75); WaterPokemon } } The WaterPokemon } } class is the subclass of the Pokemon class. 5 6 1 3/26/15 Inheritance Inheritance Key OOP Idea: Classes can inherit methods and instance variables from other classes WaterPokemon ashs_squirtle = new WaterPokemon(“Squirtle”,”Ash”, 314); Pokemon mistys_togepi = new Pokemon(“Togepi”, public class WaterPokemon extends Pokemon { “Misty”, 245); … mistys_togepi.attack(ashs_squirtle); void attack(Pokemon other) System.out.println(ashs_squirtle.getHitPts()); { The attack method 264 Pokemon class is other.decrease_hp(75); from the ashs_squirtle.attack(mistys_togepi); overridden by the } attack method from the System.out.println(mistys_togepi.getHitPts()); } WaterPokemon class.
    [Show full text]