Anyone can code: the art and science of logical creativity
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Boca Raton ; London ; New York
CRC Press
2021
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis Klappentext |
Beschreibung: | 565 Seiten Illustrationen |
ISBN: | 9780367199692 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV047212252 | ||
003 | DE-604 | ||
005 | 20210526 | ||
007 | t | ||
008 | 210324s2021 a||| |||| 00||| eng d | ||
020 | |a 9780367199692 |c (pbk) |9 978-0-367-19969-2 | ||
020 | |a 9780367199692 |c hbk |9 978-0-367-19969-2 | ||
035 | |a (OCoLC)1226554016 | ||
035 | |a (DE-599)OBVAC16165201 | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
049 | |a DE-355 | ||
084 | |a ST 110 |0 (DE-625)143583: |2 rvk | ||
100 | 1 | |a Arya, Ali |e Verfasser |4 aut | |
245 | 1 | 0 | |a Anyone can code |b the art and science of logical creativity |c Ali Arya |
264 | 1 | |a Boca Raton ; London ; New York |b CRC Press |c 2021 | |
300 | |a 565 Seiten |b Illustrationen | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 0 | 7 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a JavaScript |0 (DE-588)4420180-1 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Logische Programmierung |0 (DE-588)4195096-3 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a C |g Programmiersprache |0 (DE-588)4113195-2 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Problemlösen |0 (DE-588)4076358-4 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Logische Programmierung |0 (DE-588)4195096-3 |D s |
689 | 0 | 1 | |a Problemlösen |0 (DE-588)4076358-4 |D s |
689 | 0 | 2 | |a C |g Programmiersprache |0 (DE-588)4113195-2 |D s |
689 | 0 | 3 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |D s |
689 | 0 | 4 | |a JavaScript |0 (DE-588)4420180-1 |D s |
689 | 0 | |5 DE-604 | |
776 | 0 | 8 | |i Erscheint auch als |n Online-Ausgabe |z 978-0-429-24442-1 |
856 | 4 | 2 | |m Digitalisierung UB Regensburg - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
856 | 4 | 2 | |m Digitalisierung UB Regensburg - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000003&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA |3 Klappentext |
999 | |a oai:aleph.bib-bvb.de:BVB01-032617035 |
Datensatz im Suchindex
_version_ | 1804182327329292288 |
---|---|
adam_text | Contents List of Sidebars, xv List of Tables, xvii List of Exhibits, xix Preface, xxiii Acknowledgments, xxvii Definition of Key Terms, xxix Abbreviation, xxxi Companion Website, xxxiii PART 1 Getting Started Introduction_____________________________________________________________ 3 HELLO, WORLD! 1.1SOFTWARE DEVELOPMENT 3 11 1.1.1 Design and Implementation 14 1.1.2 Modularization 16 HIGHLIGHTS 18 END-OF-CHAPTER NOTES 18 Chapter 1 ■ Computers, Programs, and Games_________________________ 21_ OVERVIEW 21 1.1 BRIEF HISTORY OF COMPUTING 22 1.1.1 25 1.2 Properties of Digital Media CIRCUITS AND NUMBERS, BITS, AND BYTES 26 1.2.1 Decimal vs. Binary 27 1.2.2 Bits and Bytes 28 v
vi ■ Contents 1.3 1.4 WHAT IS A PROGRAM, ANYWAY? 30 1.3.1 31 Visual Programming GAMES AS PROGRAMS: DATA VS. CODE 33 HIGHLIGHTS 39 END-OF-CHAPTER NOTES 40 Chapter 2 ■ Logical Creativity _________________________________ 43 OVERVIEW 43 2.1 PROBLEM-SOLVING AND CREATIVITY 44 2.2 VISUAL DESIGN AND VISUAL THINKING 48 2.3 ALGORITHMS AND ALGORITHMIC THINKING 51 2.3.1 What Is an Algorithm? 51 2.3.2 Program Flow 56 2.3.3 Selection 57 2.3.3.1 58 2.4 2.5 Detecting Odd and Even Numbers 2.3.4 Iteration 59 2.3.5 Variables and the First Golden Rule of Programming 64 2.3.6 Loop Counter as a Variable 65 DATA-CENTERED APPROACH TO PROBLEM-SOLVING AND ALGORITHM DESIGN 66 2.4.1 68 Finding Min and Max STEPWISE REFINEMENT FOR ALGORITHMS 70 2.5.1 72 Restaurant Bill Calculation HIGHLIGHTS 75 END-OF-CHAPTER NOTES 76 PART 2 Understanding Programs Chapter 3 ■ Data: Program s Information_________________________________81 OVERVIEW 81 3.1 HIGH-LEVEL PROGRAMMING LANGUAGES 82 3.1.1 High Level vs. Low Level 83 3.1.2 Declarative vs. Imperative 83 3.1.3 Compiled vs. Interpreted 84 3.1.4 Virtual Machines 84 3.1.5 Development Environments and Tools 86
Contents ■ vii 3.2 DATA AND VARIABLES 88 3.3 PROGRAMMING IN PYTHON 94 3.4 PROGRAMMING IN C AND C++ 99 3.4.1 Compiling and Running C/C++ Programs 102 3.4.2 Comments 103 3.5 DATATYPES 107 3.5.1 TypeCasting 111 3.5.2 Integer and F!oat Operations 112 HIGHLIGHTS 114 END-OF-CHAPTER NOTES 115 Chapter 4 . Code: Program s Operation______________________________ 117 OVERVIEW 117 4.1 SEQUENTIAL EXECUTION AND PROGRAM CONTROL 118 4.1.1 GoTo Statement 118 4.1.2 Structured Programming and Control Flow 119 4.1.2.1 Function 119 4.1.2.2 Selection 120 4.1.2.3 Iteration 120 4.1.2.4 Blocks of Code and the Lexical Scope 121 4.2 4.3 SELECTION 122 4.2.1 If/Else 122 4.2.2 Switch/Case 125 ITERATION 129 4.3.1 While Loops 129 4.3.1.1 133 4.3.2 4.4 4.5 Forever Loops For Loops 134 COMBINING SELECTION AND ITERATION 136 4.4.1 Guessing Game 136 4.4.2 Simple Calculator 139 NAMING CONVENTIONS 141 4.5.1 142 #define in C/C++ HIGHLIGHTS 144 END-OF-CHAPTER NOTES 145
viii ■ Contents Chapter 5 ■ Functions______________________________________ OVERVIEW 5.1 5.2 ~ 147 147 DEFINING AND USING FUNCTIONS 148 5.1.1 152 Returning from a Function FUNCTIONS IN C/C++ 154 5.2.1 void main() 155 5.2.2 void Hello () 156 5.2.3 int GetDataO 156 5.3 LOCAL AND GLOBAL VARIABLES 157 5.4 FUNCTION PARAMETERS 163 5.4.1 Simple Board Game Simulator 167 5.4.2 BMI Calculator 171 5.4.3 Prime Number Listing 173 HIGHLIGHTS 176 END-OF-CHAPTER NOTES 176 PART 3 Structured Programming Chapter 6 ■ Types, Files, and Libraries____________________________ 181 OVERVIEW 181 6.1 DATA TYPES REVISITED 182 6.1.1 Predefined and User-Defined Types 182 6.1.1.1 183 6.2 6.3 Enumeration 6.1.1.2 Structure 186 6.1.2 Memory Address and Pointer Type 191 6.1.3 Passing Parameters to Functions 197 OUTSIDE THE FILE 200 6.2.1 Multiple Source Files 200 6.2.2 Libraries 206 GRAPHICS PROGRAMMING 208 6.3.1 Computer Graphics 208 6.3.2 Graphics in Javascript 213 6.3.3 Graphics in Python 217 6.3.4 Graphics in C/C++ 219 6.3.5 Command-Line Parameters 223
Contents ■ ix 6.3.6 Rendering 224 6.3.7 Simple 2D Game 224 6.3.7.1 Game Objects 225 6.3.7.2 Game Code Structure 225 6.3.7.3 Example 228 HIGHLIGHTS 233 END-OF-CHAPTER NOTES 234 Chapter 7 « Modularization of Data_________________________________ 237 OVERVIEW 237 7.1 USER-DEFINED TYPES AS MODULES OF DATA 238 7.1.1 Collision Detection 244 7.1.2 Vanishing Prize: How to Make Objects Disappear 246 7.1.3 Simple Game in Javascript 247 7.1.4 Events Revisited 252 7.1.5 Distance and Collision 254 7.1.6 Lives and Scores in Python 254 7.1.7 Movements and Collision 260 7.1.8 Life and Score 261 7.2 7.3 7.4 ARRAYS AS MODULES OF DATA 261 7.2.1 Arrays 261 7.2.2 Arrays in Javascript and Python 267 EXAMPLES OF USING ARRAYS 268 7.3.1 Linear Search 268 7.3.2 Ground Levels in Games 273 7.3.3 Plotting Data 275 7.3.4 Scaling and Translation 277 7.3.5 Text Processing 283 COMBINED DATA MODULES 285 7.4.1 Simple Database 285 7.4.2 2D Game with Arrays 291 7.4.3 Animated Objects 298 7.4.4 Transparent Pixels and Background Image 301 HIGHLIGHTS 302 END-OF-CHAPTER NOTES 303
x ■ Contents Chapter 8 ■ Modularization of Code___________________________________305 OVERVIEW 305 8.1 FUNCTIONS REVISITED 306 8.1.1 Using Functions to Build Modular Programs 307 8.1.2 A Modular Command Processor 311 8.1.3 What Is a Good Function? 313 8.2 INFORMATION HIDING AND ABSTRACTION 316 8.3 MODULAR DESIGN 320 8.3.1 School Database 320 8.3.2 Library Database 331 8.4 A MODULAR GAME PROGRAM 340 8.4.1 2D Side-Scroller Game 341 8.4.2 Scrolling 342 8.4.3 Defense Mode 343 8.4.4 Physics: Platforms, Jumping, and Falling 349 8.4.5 Data Types 350 8.4.6 Game Functions 350 8.4.7 Movement 351 8.4.8 Timers and Callback Functions 362 HIGHLIGHTS 364 END-OF-CHAPTER NOTES 364 PART 4 Object-Oriented Programming Chapter 9 ■ Modularization of Data and Code 369 OVERVIEW 369 9.1 OBJECTS AND CLASSES 370 9.1.1 Abstract Data Types 370 9.1.2 Encapsulation 373 9.1.3 C++ and Classes 376 9.1.4 Constructor 382 9.1.5 Python and Javascript Classes 385 9.2 OBJECT-ORIENTED PROGRAMMING 389 9.2.1 Identifying Classes and Objects 391 9.2.2 Class Development 393
Contents ■ xi 9.3 9.2.3 Constructors and the Order of Execution 399 9.2.4 Class View in Visual Studio 401 OBJECT-ORIENTED GAMES 402 9.3.1 GameObject Class 409 9.3.2 Game Class 410 9.3.3 Multiple Source Files 411 HIGHLIGHTS 415 END-OF-CHAPTER NOTES 416 Chapter 10 ■ Object-Oriented Design_____________________________419 OVERVIEW 419 10.1 SOFTWARE DESIGN WITH CLASSES 420 10.1.1 OOD Process for a Game 420 10.1.2 Requirements 421 10.1.3 Game-Related Requirements 422 10.1.4 Software-Related Requirements (for Reusability and Manageability) 423 10.1.5 Specific Requirements for Sample Game 423 10.1.6 Game Software Design 425 10.1.6.1 Render 425 10.1.6.2 Physics 426 10.1.6.3 Game 427 10.1.7 GameObject,Information Hiding, and Class Access Control 427 10.1.8 Implementing Class Methods 430 10.1.8.1 GameObject 430 10.1.8.2 Game 431 10.1.8.3 Render 431 10.1.8.4 Physics 433 10.2 DYNAMIC OBJECTS 435 10.2.1 Dynamic Arrays and Objects 435 10.2.2 Dynamic Object Creation 441 10.2.3 Object Destructor 443 10.2.4 Particle Systems 445 10.2.5 Smoke Particle System Requirements 445 10.2.6 Smoke Particle System Design 446 10.2.7 Smoke Particle System Functions 447
xii ■ Contents 10.2.8 Using the Smoke Partide System 452 HIGHLIGHTS 454 END-OF-CHAPTER NOTES 455 PART 5 More about Objects and Classes Chapter 11 ■ Class Hierarchies___________________________________ 459 OVERVIEW 459 11.1 EXTENDING CLASSES WITH INHERITANCE 460 11.1.1 C++ Student Class Revisited 460 11.1.2 Different Yet Similar Classes 465 11.1.3 Inheritance in Python and Javascript 474 11.1.4 Python Inheritance Example 476 11.1.5 Javascript Inheritance Example 479 11.2 DIFFERENT TYPES OF GAME OBJECTS 480 11.2.1 OpenFrameworks 481 11.2.2 ofApp Class 483 11.2.3 Customizing the Project 483 11.2.4 Adding New Content 484 11.2.5 GameObject Class 485 11.2.6 Game Class 486 11.2.7 Enemy vs. Player 489 11.2.8 Animation Revisited 493 HIGHLIGHTS 495 END-OF-CHAPTER NOTES 496 Chapter 12 · Object Identities___________________________________ 497 OVERVIEW 497 12.1 RENDERING MULTIPLE GAMEOBJECT TYPES 498 12.1.1 OF-Based Render Class 499 12.1.2 Function Overloading 501 12.1.3 Multiple GameObject Types 502 12.1.4 Inheritance and Identities 502 12.2 DYNAMIC POLYMORPHISM 503 12.2.1 Visual Effects and Image Processing 506 12.2.2 Basic Image Processing 508
Contents ■ xiii 12.2.3 Sample Image Effects 510 12.2.4 Effect Classes 513 12.2.5 Rendering with Effects 517 12.2.6 Using Dynamic Polymorphism in Render Class 518 12.2.7 Polymorphism in Python and Javascript 519 12.3 PHYSICS CLASS REVISITED 520 12.3.1 Heightmaps 522 12.3.2 Static Members 526 HIGHLIGHTS 527 END-OF-CHAPTER NOTES 528 PART 6 Moving Forward Chapter 13 ■ Software Design______________________________________ 533 OVERVIEW 533 13.1 DESIGN PATTERNS 534 13.2 DATA STRUCTURES 536 13.3 SOFTWARE ARCHITECTURE 538 13.4 SUGGESTED PROJECTS 540 13.4.1 Image Editor 540 13.4.2 Game AI 541 Chapter 14 ■ Software Projects_____________________________________ 543 OVERVIEW 543 14.1 PROJECTMANAGEMENT 544 14.2 VERSION CONTROL 545 Chapter 15 ■ Concluding Notes_____________________________________ 547 OVERVIEW 547 15.1 SUMMARY OF KEY POINTS 547 15.2 SOME PRACTICAL ADVICE 548 BIBLIOGRAPHY, 551 INDEX, 553
“Ali Arya guides you in a fantastic journey full of creativity in a coherent way that allows the traveler to learn and build up over the knowledge acquired in previous chapters until the reader accomplishes skills to develop solutions using programming.” — Andrés A. Navarro Newball, Professor, Pontificia Universidad Javenana, Cali. Colombia “An excellent book that teaches programming and software development the way it should be done: independent from a specific implementation language and focusing on the main principles that are fundamental and substantive to any kind of software production.” — Marc Conrad, Principal Lecturer, University of Bedfordshire. Luton, UK Anyone Can Code: The Art and Science of Logical Creativity introduces computer programming as a way of problem-solving through logical thinking. It uses the notion of modularization as a central lens through which we can make sense of many software concepts. This book takes the reader through fundamental concepts in programming by illustrating them in three different and distinct languages: C/C+ + . Python, and Javascript. Key features: • • • Focuses on problem-solving and algorithmic thinking instead of programming functions, syntax, and libraries Includes engaging examples, including video games and visual effects Provides exercises and reflective questions This book gives beginner and intermediate learners a strong understanding of what they are doing so that they can do it better and with any other tool or language that they may end up using later. Author Ali Arya is an Associate Professor in the School of
Information Technology at Carleton University, Ottawa, Canada. He received his PhD in Computer Engineering from the University of British Columbia. Vancouver, Canada, in 2003. He has over 25 years of experience in professional and academic positions related to software development and information technology. He is passionate about computer programming that brings together logical and creative abilities.
|
adam_txt |
Contents List of Sidebars, xv List of Tables, xvii List of Exhibits, xix Preface, xxiii Acknowledgments, xxvii Definition of Key Terms, xxix Abbreviation, xxxi Companion Website, xxxiii PART 1 Getting Started Introduction_ 3 HELLO, WORLD! 1.1SOFTWARE DEVELOPMENT 3 11 1.1.1 Design and Implementation 14 1.1.2 Modularization 16 HIGHLIGHTS 18 END-OF-CHAPTER NOTES 18 Chapter 1 ■ Computers, Programs, and Games_ 21_ OVERVIEW 21 1.1 BRIEF HISTORY OF COMPUTING 22 1.1.1 25 1.2 Properties of Digital Media CIRCUITS AND NUMBERS, BITS, AND BYTES 26 1.2.1 Decimal vs. Binary 27 1.2.2 Bits and Bytes 28 v
vi ■ Contents 1.3 1.4 WHAT IS A PROGRAM, ANYWAY? 30 1.3.1 31 Visual Programming GAMES AS PROGRAMS: DATA VS. CODE 33 HIGHLIGHTS 39 END-OF-CHAPTER NOTES 40 Chapter 2 ■ Logical Creativity _ 43 OVERVIEW 43 2.1 PROBLEM-SOLVING AND CREATIVITY 44 2.2 VISUAL DESIGN AND VISUAL THINKING 48 2.3 ALGORITHMS AND ALGORITHMIC THINKING 51 2.3.1 What Is an Algorithm? 51 2.3.2 Program Flow 56 2.3.3 Selection 57 2.3.3.1 58 2.4 2.5 Detecting Odd and Even Numbers 2.3.4 Iteration 59 2.3.5 Variables and the First Golden Rule of Programming 64 2.3.6 Loop Counter as a Variable 65 DATA-CENTERED APPROACH TO PROBLEM-SOLVING AND ALGORITHM DESIGN 66 2.4.1 68 Finding Min and Max STEPWISE REFINEMENT FOR ALGORITHMS 70 2.5.1 72 Restaurant Bill Calculation HIGHLIGHTS 75 END-OF-CHAPTER NOTES 76 PART 2 Understanding Programs Chapter 3 ■ Data: Program's Information_81 OVERVIEW 81 3.1 HIGH-LEVEL PROGRAMMING LANGUAGES 82 3.1.1 High Level vs. Low Level 83 3.1.2 Declarative vs. Imperative 83 3.1.3 Compiled vs. Interpreted 84 3.1.4 Virtual Machines 84 3.1.5 Development Environments and Tools 86
Contents ■ vii 3.2 DATA AND VARIABLES 88 3.3 PROGRAMMING IN PYTHON 94 3.4 PROGRAMMING IN C AND C++ 99 3.4.1 Compiling and Running C/C++ Programs 102 3.4.2 Comments 103 3.5 DATATYPES 107 3.5.1 TypeCasting 111 3.5.2 Integer and F!oat Operations 112 HIGHLIGHTS 114 END-OF-CHAPTER NOTES 115 Chapter 4 . Code: Program's Operation_ 117 OVERVIEW 117 4.1 SEQUENTIAL EXECUTION AND PROGRAM CONTROL 118 4.1.1 GoTo Statement 118 4.1.2 Structured Programming and Control Flow 119 4.1.2.1 Function 119 4.1.2.2 Selection 120 4.1.2.3 Iteration 120 4.1.2.4 Blocks of Code and the Lexical Scope 121 4.2 4.3 SELECTION 122 4.2.1 If/Else 122 4.2.2 Switch/Case 125 ITERATION 129 4.3.1 While Loops 129 4.3.1.1 133 4.3.2 4.4 4.5 Forever Loops For Loops 134 COMBINING SELECTION AND ITERATION 136 4.4.1 Guessing Game 136 4.4.2 Simple Calculator 139 NAMING CONVENTIONS 141 4.5.1 142 #define in C/C++ HIGHLIGHTS 144 END-OF-CHAPTER NOTES 145
viii ■ Contents Chapter 5 ■ Functions_ OVERVIEW 5.1 5.2 ~ 147 147 DEFINING AND USING FUNCTIONS 148 5.1.1 152 Returning from a Function FUNCTIONS IN C/C++ 154 5.2.1 void main() 155 5.2.2 void Hello () 156 5.2.3 int GetDataO 156 5.3 LOCAL AND GLOBAL VARIABLES 157 5.4 FUNCTION PARAMETERS 163 5.4.1 Simple Board Game Simulator 167 5.4.2 BMI Calculator 171 5.4.3 Prime Number Listing 173 HIGHLIGHTS 176 END-OF-CHAPTER NOTES 176 PART 3 Structured Programming Chapter 6 ■ Types, Files, and Libraries_ 181 OVERVIEW 181 6.1 DATA TYPES REVISITED 182 6.1.1 Predefined and User-Defined Types 182 6.1.1.1 183 6.2 6.3 Enumeration 6.1.1.2 Structure 186 6.1.2 Memory Address and Pointer Type 191 6.1.3 Passing Parameters to Functions 197 OUTSIDE THE FILE 200 6.2.1 Multiple Source Files 200 6.2.2 Libraries 206 GRAPHICS PROGRAMMING 208 6.3.1 Computer Graphics 208 6.3.2 Graphics in Javascript 213 6.3.3 Graphics in Python 217 6.3.4 Graphics in C/C++ 219 6.3.5 Command-Line Parameters 223
Contents ■ ix 6.3.6 Rendering 224 6.3.7 Simple 2D Game 224 6.3.7.1 Game Objects 225 6.3.7.2 Game Code Structure 225 6.3.7.3 Example 228 HIGHLIGHTS 233 END-OF-CHAPTER NOTES 234 Chapter 7 « Modularization of Data_ 237 OVERVIEW 237 7.1 USER-DEFINED TYPES AS MODULES OF DATA 238 7.1.1 Collision Detection 244 7.1.2 Vanishing Prize: How to Make Objects Disappear 246 7.1.3 Simple Game in Javascript 247 7.1.4 Events Revisited 252 7.1.5 Distance and Collision 254 7.1.6 Lives and Scores in Python 254 7.1.7 Movements and Collision 260 7.1.8 Life and Score 261 7.2 7.3 7.4 ARRAYS AS MODULES OF DATA 261 7.2.1 Arrays 261 7.2.2 Arrays in Javascript and Python 267 EXAMPLES OF USING ARRAYS 268 7.3.1 Linear Search 268 7.3.2 Ground Levels in Games 273 7.3.3 Plotting Data 275 7.3.4 Scaling and Translation 277 7.3.5 Text Processing 283 COMBINED DATA MODULES 285 7.4.1 Simple Database 285 7.4.2 2D Game with Arrays 291 7.4.3 Animated Objects 298 7.4.4 Transparent Pixels and Background Image 301 HIGHLIGHTS 302 END-OF-CHAPTER NOTES 303
x ■ Contents Chapter 8 ■ Modularization of Code_305 OVERVIEW 305 8.1 FUNCTIONS REVISITED 306 8.1.1 Using Functions to Build Modular Programs 307 8.1.2 A Modular Command Processor 311 8.1.3 What Is a Good Function? 313 8.2 INFORMATION HIDING AND ABSTRACTION 316 8.3 MODULAR DESIGN 320 8.3.1 School Database 320 8.3.2 Library Database 331 8.4 A MODULAR GAME PROGRAM 340 8.4.1 2D Side-Scroller Game 341 8.4.2 Scrolling 342 8.4.3 Defense Mode 343 8.4.4 Physics: Platforms, Jumping, and Falling 349 8.4.5 Data Types 350 8.4.6 Game Functions 350 8.4.7 Movement 351 8.4.8 Timers and Callback Functions 362 HIGHLIGHTS 364 END-OF-CHAPTER NOTES 364 PART 4 Object-Oriented Programming Chapter 9 ■ Modularization of Data and Code 369 OVERVIEW 369 9.1 OBJECTS AND CLASSES 370 9.1.1 Abstract Data Types 370 9.1.2 Encapsulation 373 9.1.3 C++ and Classes 376 9.1.4 Constructor 382 9.1.5 Python and Javascript Classes 385 9.2 OBJECT-ORIENTED PROGRAMMING 389 9.2.1 Identifying Classes and Objects 391 9.2.2 Class Development 393
Contents ■ xi 9.3 9.2.3 Constructors and the Order of Execution 399 9.2.4 Class View in Visual Studio 401 OBJECT-ORIENTED GAMES 402 9.3.1 GameObject Class 409 9.3.2 Game Class 410 9.3.3 Multiple Source Files 411 HIGHLIGHTS 415 END-OF-CHAPTER NOTES 416 Chapter 10 ■ Object-Oriented Design_419 OVERVIEW 419 10.1 SOFTWARE DESIGN WITH CLASSES 420 10.1.1 OOD Process for a Game 420 10.1.2 Requirements 421 10.1.3 Game-Related Requirements 422 10.1.4 Software-Related Requirements (for Reusability and Manageability) 423 10.1.5 Specific Requirements for Sample Game 423 10.1.6 Game Software Design 425 10.1.6.1 Render 425 10.1.6.2 Physics 426 10.1.6.3 Game 427 10.1.7 GameObject,Information Hiding, and Class Access Control 427 10.1.8 Implementing Class Methods 430 10.1.8.1 GameObject 430 10.1.8.2 Game 431 10.1.8.3 Render 431 10.1.8.4 Physics 433 10.2 DYNAMIC OBJECTS 435 10.2.1 Dynamic Arrays and Objects 435 10.2.2 Dynamic Object Creation 441 10.2.3 Object Destructor 443 10.2.4 Particle Systems 445 10.2.5 Smoke Particle System Requirements 445 10.2.6 Smoke Particle System Design 446 10.2.7 Smoke Particle System Functions 447
xii ■ Contents 10.2.8 Using the Smoke Partide System 452 HIGHLIGHTS 454 END-OF-CHAPTER NOTES 455 PART 5 More about Objects and Classes Chapter 11 ■ Class Hierarchies_ 459 OVERVIEW 459 11.1 EXTENDING CLASSES WITH INHERITANCE 460 11.1.1 C++ Student Class Revisited 460 11.1.2 Different Yet Similar Classes 465 11.1.3 Inheritance in Python and Javascript 474 11.1.4 Python Inheritance Example 476 11.1.5 Javascript Inheritance Example 479 11.2 DIFFERENT TYPES OF GAME OBJECTS 480 11.2.1 OpenFrameworks 481 11.2.2 ofApp Class 483 11.2.3 Customizing the Project 483 11.2.4 Adding New Content 484 11.2.5 GameObject Class 485 11.2.6 Game Class 486 11.2.7 Enemy vs. Player 489 11.2.8 Animation Revisited 493 HIGHLIGHTS 495 END-OF-CHAPTER NOTES 496 Chapter 12 · Object Identities_ 497 OVERVIEW 497 12.1 RENDERING MULTIPLE GAMEOBJECT TYPES 498 12.1.1 OF-Based Render Class 499 12.1.2 Function Overloading 501 12.1.3 Multiple GameObject Types 502 12.1.4 Inheritance and Identities 502 12.2 DYNAMIC POLYMORPHISM 503 12.2.1 Visual Effects and Image Processing 506 12.2.2 Basic Image Processing 508
Contents ■ xiii 12.2.3 Sample Image Effects 510 12.2.4 Effect Classes 513 12.2.5 Rendering with Effects 517 12.2.6 Using Dynamic Polymorphism in Render Class 518 12.2.7 Polymorphism in Python and Javascript 519 12.3 PHYSICS CLASS REVISITED 520 12.3.1 Heightmaps 522 12.3.2 Static Members 526 HIGHLIGHTS 527 END-OF-CHAPTER NOTES 528 PART 6 Moving Forward Chapter 13 ■ Software Design_ 533 OVERVIEW 533 13.1 DESIGN PATTERNS 534 13.2 DATA STRUCTURES 536 13.3 SOFTWARE ARCHITECTURE 538 13.4 SUGGESTED PROJECTS 540 13.4.1 Image Editor 540 13.4.2 Game AI 541 Chapter 14 ■ Software Projects_ 543 OVERVIEW 543 14.1 PROJECTMANAGEMENT 544 14.2 VERSION CONTROL 545 Chapter 15 ■ Concluding Notes_ 547 OVERVIEW 547 15.1 SUMMARY OF KEY POINTS 547 15.2 SOME PRACTICAL ADVICE 548 BIBLIOGRAPHY, 551 INDEX, 553
“Ali Arya guides you in a fantastic journey full of creativity in a coherent way that allows the traveler to learn and build up over the knowledge acquired in previous chapters until the reader accomplishes skills to develop solutions using programming.” — Andrés A. Navarro Newball, Professor, Pontificia Universidad Javenana, Cali. Colombia “An excellent book that teaches programming and software development the way it should be done: independent from a specific implementation language and focusing on the main principles that are fundamental and substantive to any kind of software production.” — Marc Conrad, Principal Lecturer, University of Bedfordshire. Luton, UK Anyone Can Code: The Art and Science of Logical Creativity introduces computer programming as a way of problem-solving through logical thinking. It uses the notion of modularization as a central lens through which we can make sense of many software concepts. This book takes the reader through fundamental concepts in programming by illustrating them in three different and distinct languages: C/C+ + . Python, and Javascript. Key features: • • • Focuses on problem-solving and algorithmic thinking instead of programming functions, syntax, and libraries Includes engaging examples, including video games and visual effects Provides exercises and reflective questions This book gives beginner and intermediate learners a strong understanding of what they are doing so that they can do it better and with any other tool or language that they may end up using later. Author Ali Arya is an Associate Professor in the School of
Information Technology at Carleton University, Ottawa, Canada. He received his PhD in Computer Engineering from the University of British Columbia. Vancouver, Canada, in 2003. He has over 25 years of experience in professional and academic positions related to software development and information technology. He is passionate about computer programming that brings together logical and creative abilities. |
any_adam_object | 1 |
any_adam_object_boolean | 1 |
author | Arya, Ali |
author_facet | Arya, Ali |
author_role | aut |
author_sort | Arya, Ali |
author_variant | a a aa |
building | Verbundindex |
bvnumber | BV047212252 |
classification_rvk | ST 110 |
ctrlnum | (OCoLC)1226554016 (DE-599)OBVAC16165201 |
discipline | Informatik |
discipline_str_mv | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>02136nam a2200445 c 4500</leader><controlfield tag="001">BV047212252</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20210526 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">210324s2021 a||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9780367199692</subfield><subfield code="c">(pbk)</subfield><subfield code="9">978-0-367-19969-2</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9780367199692</subfield><subfield code="c">hbk</subfield><subfield code="9">978-0-367-19969-2</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)1226554016</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)OBVAC16165201</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-355</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 110</subfield><subfield code="0">(DE-625)143583:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Arya, Ali</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Anyone can code</subfield><subfield code="b">the art and science of logical creativity</subfield><subfield code="c">Ali Arya</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Boca Raton ; London ; New York</subfield><subfield code="b">CRC Press</subfield><subfield code="c">2021</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">565 Seiten</subfield><subfield code="b">Illustrationen</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Python</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4434275-5</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">JavaScript</subfield><subfield code="0">(DE-588)4420180-1</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Logische Programmierung</subfield><subfield code="0">(DE-588)4195096-3</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">C</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4113195-2</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Problemlösen</subfield><subfield code="0">(DE-588)4076358-4</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Logische Programmierung</subfield><subfield code="0">(DE-588)4195096-3</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Problemlösen</subfield><subfield code="0">(DE-588)4076358-4</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="2"><subfield code="a">C</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4113195-2</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="3"><subfield code="a">Python</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4434275-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="4"><subfield code="a">JavaScript</subfield><subfield code="0">(DE-588)4420180-1</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="776" ind1="0" ind2="8"><subfield code="i">Erscheint auch als</subfield><subfield code="n">Online-Ausgabe</subfield><subfield code="z">978-0-429-24442-1</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Regensburg - ADAM Catalogue Enrichment</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Regensburg - ADAM Catalogue Enrichment</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000003&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Klappentext</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-032617035</subfield></datafield></record></collection> |
id | DE-604.BV047212252 |
illustrated | Illustrated |
index_date | 2024-07-03T16:54:44Z |
indexdate | 2024-07-10T09:05:47Z |
institution | BVB |
isbn | 9780367199692 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-032617035 |
oclc_num | 1226554016 |
open_access_boolean | |
owner | DE-355 DE-BY-UBR |
owner_facet | DE-355 DE-BY-UBR |
physical | 565 Seiten Illustrationen |
publishDate | 2021 |
publishDateSearch | 2021 |
publishDateSort | 2021 |
publisher | CRC Press |
record_format | marc |
spelling | Arya, Ali Verfasser aut Anyone can code the art and science of logical creativity Ali Arya Boca Raton ; London ; New York CRC Press 2021 565 Seiten Illustrationen txt rdacontent n rdamedia nc rdacarrier Python Programmiersprache (DE-588)4434275-5 gnd rswk-swf JavaScript (DE-588)4420180-1 gnd rswk-swf Logische Programmierung (DE-588)4195096-3 gnd rswk-swf C Programmiersprache (DE-588)4113195-2 gnd rswk-swf Problemlösen (DE-588)4076358-4 gnd rswk-swf Logische Programmierung (DE-588)4195096-3 s Problemlösen (DE-588)4076358-4 s C Programmiersprache (DE-588)4113195-2 s Python Programmiersprache (DE-588)4434275-5 s JavaScript (DE-588)4420180-1 s DE-604 Erscheint auch als Online-Ausgabe 978-0-429-24442-1 Digitalisierung UB Regensburg - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis Digitalisierung UB Regensburg - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000003&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA Klappentext |
spellingShingle | Arya, Ali Anyone can code the art and science of logical creativity Python Programmiersprache (DE-588)4434275-5 gnd JavaScript (DE-588)4420180-1 gnd Logische Programmierung (DE-588)4195096-3 gnd C Programmiersprache (DE-588)4113195-2 gnd Problemlösen (DE-588)4076358-4 gnd |
subject_GND | (DE-588)4434275-5 (DE-588)4420180-1 (DE-588)4195096-3 (DE-588)4113195-2 (DE-588)4076358-4 |
title | Anyone can code the art and science of logical creativity |
title_auth | Anyone can code the art and science of logical creativity |
title_exact_search | Anyone can code the art and science of logical creativity |
title_exact_search_txtP | Anyone can code the art and science of logical creativity |
title_full | Anyone can code the art and science of logical creativity Ali Arya |
title_fullStr | Anyone can code the art and science of logical creativity Ali Arya |
title_full_unstemmed | Anyone can code the art and science of logical creativity Ali Arya |
title_short | Anyone can code |
title_sort | anyone can code the art and science of logical creativity |
title_sub | the art and science of logical creativity |
topic | Python Programmiersprache (DE-588)4434275-5 gnd JavaScript (DE-588)4420180-1 gnd Logische Programmierung (DE-588)4195096-3 gnd C Programmiersprache (DE-588)4113195-2 gnd Problemlösen (DE-588)4076358-4 gnd |
topic_facet | Python Programmiersprache JavaScript Logische Programmierung C Programmiersprache Problemlösen |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=032617035&sequence=000003&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT aryaali anyonecancodetheartandscienceoflogicalcreativity |