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

Category: Uncategorized

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” »

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” »

Data Transformation with Regex

Posted on February 1, 2024February 2, 2024 By William Jojo
Uncategorized

Overview Sometimes, we have data in one form that needs to be put into another as code or storage in a database. Many editors, like Sublime Text, have Find/Replace tools for complex data transformations. IntelliJ has a similar facility within its editor (Edit/Find/Replace). This brief tutorial explains some regexes (regular expressions) used to achieve quick … Read More “Data Transformation with Regex” »

CISS-111 Project 2 Getting Started

Posted on February 8, 2023February 8, 2025 By William Jojo
Uncategorized

(Updated February 8, 2025) Overview In case anyone is having trouble getting started, here are a few screenshots of how your environment in IntelliJ must look. Here is the view with the TokenType enumeration. Another view with the main code. And a final view with the 6502 test program. The Record section of the textbook … Read More “CISS-111 Project 2 Getting Started” »

Your first example of a clever solution.

Posted on January 19, 2023January 19, 2023 By William Jojo
Uncategorized

People who know me are familiar with how, generally, I’m not too fond of clever solutions. This is because clever ones often are flawed in some subtle way that leads to bugs later. I prefer clear, precise solutions. The situation below was a little different, and now I task you with solving the same problem … Read More “Your first example of a clever solution.” »

CISS-150 Windows Memory

Posted on October 18, 2021 By William Jojo
Uncategorized

Overview The memory layout of Windows is a bit more complex than that of Linux. While we have seen some of the Linux memory model, it is also a good idea to get a sense of how other OSes perform similar memory virtualization. Get the Software Login to your Windows 10 guest and get the … Read More “CISS-150 Windows Memory” »

Posts pagination

1 2 … 4 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.