(Updated December 29, 2022) The idea behind interactive fiction (IF) is to create a world in which the player is captivated by the need to use their imagination to determine the next step to winning the game. IF does not use graphics, it is entirely text-based, and the player is encouraged to take notes and … Read More “JPbD Interactive Fiction Interlude 1” »
Category: Java Book
(Updated September 1, 2024) Table of contents Overview Mean, Median and Mode Sorting Bubble Sort Selection Sort Insertion Sort Shell Sort Quick Sort Sort Stress Test Searching Linear (Sequential) Search Binary Search Hash (Table) Search Exercises Overview Once we have data in arrays, we quickly realize the value of that data being in one place … Read More “Chapter 9 Supplement – Sorting and Searching” »
(Updated September 1, 2024) Table of contents Overview Arrays Dynamic Arrays, Initialization and length Array Processing Copying Arrays Arrays of Objects Variable Length Parameter List Two-Dimensional Arrays Review Summing Arrays Managing Arrays Quiz Afterward Exercises Overview In the past, when faced with calculating an average, we could sum up values entered by the user (or … Read More “Chapter 9 – Arrays” »
(Updated September 1, 2024) Table of contents Overview Classes Constructors Variables and Instantiation Constructors and Methods of the Person Class Copy Constructor The toString Method Static Members of a Class The this Reference Method Chaining Inner Classes and File Scope Records Exercises Overview Up to this point, we have been solving problems using objects. Recall … Read More “Chapter 8 – User Defined Classes and Abstract Data Types” »
(Updated August 15, 2020) Table of Contents JavaFX JavaFx We will be using JavaFX for this next phase. The main logic has been designed and tested using the text-based game play model. Now we will begin designing the GUI portion. Below is a a rough picture with pixel heights and widths defined. Figure 1: Detailed … Read More “JPbD CodeBreaker Interlude 4b” »
(Updated November 23, 2023) Table of contents JavaFX Overview Dialogs JavaFX Application The Stage The Scene Common UI Controls Layouts Events Graphics Exercises JavaFX Overview The JavaFX runtime environment is built upon the idea of a JavaFX application. Unlike Swing, a series of components that your application can extend, JavaFX uses the Application class to … Read More “Chapter 7b – Graphical User Interface – JavaFX” »
(Updated October 29, 2024) Table of contents Overview Windows and JFrame Adding Objects to JFrame Layouts (an introduction) Labels and Text Fields (JLabel, JTextField) Buttons (JButton) Event Handling Additional Layouts Graphics Exercises Overview The first time we used the GUI was back in the Objects, Input & Output section. Recall that the javax.swing package was … Read More “Chapter 7a – Graphical User Interface – Swing” »
(Updated September 1, 2024) Table of contents Overview Getting Started User-Defined Methods Calling Our Methods void Methods Value-returning Methods Method Overloading Parameters Revisited Quiz Exercises Overview User-defined methods are methods created by the application writer to support a particular feature, to fulfill a specific need that has not already been met through the use of … Read More “Chapter 6 – User Defined Methods” »
(Updated September 1, 2024) Table of Contents So, About the Secret… Game Play – Introduction Checking for Validity Checking for Accuracy – Setup Checking for Accuracy – Right Color, Right Place Checking for Accuracy – Right Color, Wrong Place Report the Findings Future Code Additions Complete Code So, About the Secret… We will break with … Read More “JPbD CodeBreaker Interlude 3” »
(Updated November 21, 2024) Table of contents Overview The while loop Range-based or Counter-based loop Sentinel-based loop Flag-based loop EOF-based loop The for loop The do-while loop The break and continue statements Nested Loops File Handling Quiz Building a Command Line Interface Exercises Overview There is a clear need for repetition in many things during … Read More “Chapter 5 – Iterative Control Structures and Files” »