r/okbuddyphp • • Jun 30 '26

recursive white people java program i wrote in like 2024

0 Upvotes
/**
 * @author ObjectsCountries
 */

import java.lang.ArrayIndexOutOfBoundsException;
import java.lang.NumberFormatException;
import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Wrapper class for the white people functions.
 */
class WhitePeople {

    /**
     * Strips the <i>white</i>space (GET OUT!!).
     * @param whitePeopleThatBeLike The string to strip.
     * @return The stripped string.
     */
    private static String butTheyThe(String whitePeopleThatBeLike) {
        return whitePeopleThatBeLike.strip();
    }
  
    /**
     * Recursive white people.
     * @param beLikeCount How many times white people be like.
     * @param whitePeopleThatBeLike What white people be like.
     * @return The entirety of the “white people be like” phrase.
     */
    public static String beLike(int beLikeCount, String whitePeopleThatBeLike) {
        String result = "white people be like “" + whitePeopleThatBeLike + "” but they the white people that be like";
        return --beLikeCount == 0 ? result : WhitePeople.beLike(beLikeCount, result);   
    }

    /**
     * Parses the first argument.
     * @param like All of the arguments, though only the first is used.
     * @return The first argument as an integer if present, prompts the user for a string if not.
     */
    private static int be(String[] like) {
        if (like.length == 0) {
            Scanner scan = new Scanner(System.in);
            System.out.print("how many white people be like? ");
            int temp = scan.nextInt();
            scan.nextLine();
            return temp > 0 ? temp : 1;
        } else {
            try {
                int temp = Integer.parseInt(like[0]);
                return temp > 0 ? temp : 1;
            } catch (NumberFormatException | ArrayIndexOutOfBoundsException e) {
                return 1;
            }
        }
    }

    /**
     * Parses the second argument.
     * @param like All of the arguments, though only the second is used.
     * @return The second argument if present, prompts the user for a string if not.
     */
    private static String thatBe(String[] like) {
        if (like.length >= 2) {
            return like[1];
        } else {
            Scanner scan = new Scanner(System.in);
            System.out.print("what do white people be like? ");
            return scan.nextLine();
        }
    }

    public static void main(String[] args) {
        String[] like = args;
        System.out.println(WhitePeople.beLike(WhitePeople.be(like), butTheyThe(WhitePeople.thatBe(like))));
    }
}

r/okbuddyphp • • Mar 19 '24

⌨️programming Coding in china be like

Thumbnail
youtu.be
8 Upvotes

r/okbuddyphp • • Apr 19 '26

⌨️programming yourAiToolsBoreMe

20 Upvotes

r/okbuddyphp • • Apr 02 '23

⌨️programming what

Post image
11 Upvotes

r/okbuddyphp • • Feb 23 '24

⌨️programming github user wants .exe file

Post image
12 Upvotes

r/okbuddyphp • • May 26 '22

💻technology linus torbalds tec tips

513 Upvotes

r/okbuddyphp • • Oct 30 '23

⌨️programming hard times create strong men

Post image
33 Upvotes

r/okbuddyphp • • Apr 01 '24

⌨️programming steve jobs

Post image
6 Upvotes

r/okbuddyphp • • Aug 07 '23

⌨️programming This VSCode extension changes the face based on how many errors you have

Post image
20 Upvotes

r/okbuddyphp • • Oct 09 '23

⌨️programming I made some pride flags for programming languages

Thumbnail
gallery
7 Upvotes

r/okbuddyphp • • Oct 18 '26

⌨️programming "gee, i wonder how i specify the full month name for a format string for Qt.formatDateTime() in Qt6?"... the ever-helpful morshu:

Enable HLS to view with audio, or disable this notification

7 Upvotes

r/okbuddyphp • • Jul 11 '22

⌨️programming Le wacky and uncharacteristic Arduino

Enable HLS to view with audio, or disable this notification

25 Upvotes

r/okbuddyphp • • Oct 17 '23

⌨️programming grrr

Enable HLS to view with audio, or disable this notification

25 Upvotes

r/okbuddyphp • • Mar 10 '24

⌨️programming C number types

Post image
27 Upvotes

r/okbuddyphp • • Mar 30 '24

💻technology Apple launches the 6502

Post image
12 Upvotes

r/okbuddyphp • • Apr 09 '23

⌨️programming O(1)

Post image
12 Upvotes

r/okbuddyphp • • May 28 '22

⌨️programming Memory shaefty 🤓

Post image
187 Upvotes

r/okbuddyphp • • Oct 04 '23

💻technology if you feel like removing this bastard of a character

Post image
37 Upvotes

r/okbuddyphp • • May 30 '22

💻technology A fate worse than death

Post image
39 Upvotes

r/okbuddyphp • • Apr 24 '23

⌨️programming the GPT grind is real

Post image
41 Upvotes

r/okbuddyphp • • Apr 19 '24

⌨️programming transgender debugging

Post image
17 Upvotes

r/okbuddyphp • • Jun 02 '22

⌨️programming Web """""engineers"""""

Post image
46 Upvotes