Skip to content

Programming by Design

If you're not prepared to be wrong, you'll never come up with anything original. – Sir Ken Robinson

  • About
  • Java-PbD
  • C-PbD
  • ASM-PbD
  • Algorithms
  • Other

Author: William Jojo

Palindrome

Posted on October 29, 2024October 29, 2024 By William Jojo
Uncategorized

class Untitled { public static void genPal1() { for( int x = 0; x

Project 5 Showcase

Posted on October 26, 2024 By William Jojo
Uncategorized

import java.io.FileNotFoundException; import java.util.Scanner; import java.io.FileReader; import java.io.PrintWriter; public class Project { public static void main(String[] args) throws FileNotFoundException { String line, rev; int x; Scanner inFile = new Scanner(new FileReader(“Word Salad”)); PrintWriter outFile = new PrintWriter(“copy.txt”); while ( inFile.hasNext() ) { line = inFile.next().toUpperCase(); //System.out.println(line); rev = “”; for ( x = line.length() – … Read More “Project 5 Showcase” »

Project 4 Showcase

Posted on October 22, 2024March 3, 2025 By William Jojo
Uncategorized

if (player == ‘S’) { if (computer == ‘B’) { System.out.println(“Computer wins with ” + names[rand] + “.”); } else if (computer == ‘P’) { System.out.println(“Computer had ” + names[rand] + “. You won with ” + names[choices.indexOf(player)] + “.”); wins++; } else { System.out.println(“It’s a draw!”); } } else if (player == ‘P’) { … Read More “Project 4 Showcase” »

Variations on a theme – 111 – Project 1

Posted on September 25, 2024 By William Jojo
Uncategorized

String number; int radix; for (int i = 0; i < args.length; i++) { number = args[i].substring(0,args[i].indexOf(':')); radix = Integer.parseInt(args[i].substring(args[i].indexOf(':') + 1)); System.out.println(number + " base " + radix + " is " + Integer.parseInt(number, radix) + " base 10."); } if(args.length>0){ //Checking for input from user for(String input:args){ //Loop to parse //Find the numerical … Read More “Variations on a theme – 111 – Project 1” »

Chapter 6502-5 – Beyond the Basics

Posted on August 4, 2024February 15, 2025 By William Jojo
AsmBook

(Updated February 15, 2025) Table of Contents Multi-way If Test Arrays Subroutines Self-modifying Code Multi-way If Test We will use the following code to demonstrate several features once used on the 6502. Example1.asmLoad Workspace define CHROUT $FFD2 start: jsr printres lda #$65 sec sbc #$84 beq printzero bvs printovf bmi printneg bpl printpos end: brk … Read More “Chapter 6502-5 – Beyond the Basics” »

Chapter 6502-4 – The Basics

Posted on August 3, 2024February 15, 2025 By William Jojo
AsmBook

(Updated February 15, 2025) Table of Contents Moving Data Simple Math Compare and Branch Overflow Moving Data While this is a 16-bit addressable space, we can only perform operations 8 bits at a time because our registers are also 8-bit wide. As such, working with 16-bit or 32-bit quantities means some code repetition. Let’s begin … Read More “Chapter 6502-4 – The Basics” »

TEST JDoodle

Posted on July 22, 2024January 2, 2025 By William Jojo
Uncategorized

(Updated November 23, 2024) FactorialIter.javaOpen in JDoodle public class FactorialIter { public static int fact(int n) { int prod = 1; if ( n < 0 ) throw new IllegalArgumentException("Value cannot be negative."); for (int i = n; i > 1; i–) prod = prod * i; return prod; } public static void main(String [] … Read More “TEST JDoodle” »

TEST 6502

Posted on July 22, 2024November 18, 2024 By William Jojo
Uncategorized

(Updated November 18, 2024) Printing.asmLoad Workspace define CHROUT $ffd2 ldx #0 ; set index to zero print: lda words,x ; load a letter from words beq done ; if it’s the zero, we’re done jsr CHROUT ; print the character inx ; increment the index bne print ; keep printing done: brk ; end! ; … Read More “TEST 6502” »

PKI and SSL

Posted on July 9, 2024August 13, 2024 By William Jojo
ciss-111, Other

(Updated July 10, 2024) Table of contents Overview Certificates Requesting Certificates Cipher Suites File Formats Configurations VICE Overview Overview The secure exchange of information is essential to protecting vital data sent over networks. Here, we will look at the details related to PKI and SSL. Public key infrastructure (PKI) governs the issuance of digital certificates … Read More “PKI and SSL” »

Chapter 6502-3 – The Assembler

Posted on June 7, 2024February 7, 2025 By William Jojo
AsmBook

(Updated February 7, 2025) Table of Contents Programs The Assembler Breakdown Features Errors Programs Let’s take a 10,000-foot tour. Our IDE has a form of compiler called an assembler. That is because it assembles the mnemonics, addresses, names, and such for a given CPU and translates it to machine code. In comparison, a compiler translates … Read More “Chapter 6502-3 – The Assembler” »

Posts pagination

Previous 1 2 3 … 18 Next

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright © 2018 – 2025 Programming by Design.