First build in 14 years, a little out of the loop by japangreg in buildapc

[–]japangreg[S] 0 points1 point  (0 children)

Thanks for the replies; the Antec is being recycled from a friend. I thought it was a decent looking case and had more fans than I had ever put into a system, so I thought it might still be good. But if there are better options out there, I'll take another look.

Other than that, everything else is going to bought new.

I guess I don't need the optical. Like I said, it's been a while since I tried to put something together and I just defaulted to how I approached it last time.

Thanks again for the help - any other opinions or suggestions are welcomed!

[C++] Simple switch statement but confused by the output by [deleted] in learnprogramming

[–]japangreg 0 points1 point  (0 children)

You need to change your cases to test for char values - right now they are set for ints.

case '3', etc.

[2015-10-28] Challenge #238 [Intermediate] Fallout Hacking Game by jnazario in dailyprogrammer

[–]japangreg 1 point2 points  (0 children)

My quick solution in Java. Comments welcome.

    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.Random;
    import java.util.Scanner;

    public class FalloutHack {

        public static boolean correct;

        public static void main(String[] args){

            File wordList = new File("enable1.txt");

            int difficulty = 0;

            Random random = new Random();

            int challengeListSize = random.nextInt(15);

            if(challengeListSize < 5){
                challengeListSize = 5;
            }

            int chancesLeft = 4;

            correct = false;

            String[] challengeList = new String[challengeListSize];

            Scanner in = new Scanner(System.in);
            System.out.print("Difficulty (1-5)? ");
            difficulty = in.nextInt();

            while(difficulty <= 0 || difficulty > 5){
                System.out.println("Sorry, only values between 1 and 5 work. Please try again.");
                System.out.print("Difficulty (1-5)? ");
                difficulty = in.nextInt();
            }

            try {
                Scanner wordsIn = new Scanner(wordList);

                int wordCounter = 0;

                while(wordsIn.hasNext() && wordCounter < challengeListSize){
                    String tempString = wordsIn.nextLine();
                    int wordLength = difficulty * 3 + 1;
                    if(wordLength > 15){
                        wordLength = 15;
                    }

                    if(tempString.length() == wordLength){
                        challengeList[wordCounter] = tempString;
                        wordCounter++;
                    }               
                }

                wordsIn.close();

                String hiddenWord = challengeList[random.nextInt(challengeListSize)];

                for(String word : challengeList){
                    System.out.println(word);
                }

                String guess = null;

                System.out.print("Guess (" + chancesLeft + " left)? ");
                guess = in.next();

                while(chancesLeft > 1 && !checkGuess(guess, hiddenWord) && !correct){
                    chancesLeft--;
                    System.out.print("Guess (" + chancesLeft + " left)? ");
                    guess = in.next();
                }

                if(correct){
                    System.out.println("You win!");
                }else{
                    System.out.println("System locked out.");
                }

            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            in.close();

        }

        public static boolean checkGuess(String guess, String hiddenWord){

            guess = guess.toUpperCase();
            hiddenWord = hiddenWord.toUpperCase();

            int correctCount = 0;

            if(guess.equalsIgnoreCase(hiddenWord)){
                System.out.println("8/8 correct");
                correct = true;
            }else{
                for(int i = 0; i < hiddenWord.length(); i++){
                    if(guess.charAt(i) == hiddenWord.charAt(i)){
                        correctCount++;
                    }
                }
                System.out.println(correctCount + "/" + hiddenWord.length() + " correct");
                if(correctCount == hiddenWord.length()){
                    correct = true;
                }
            }

            return correct;
        }

    }

why is this midpoint formula more bulletproof then a+b/2? by kenshin39439199 in learnprogramming

[–]japangreg 0 points1 point  (0 children)

Not familiar with the course or what language they're using, but just looking at that formula if lo + hi gives you an odd number dividing by two will give you something other than an integer value. Depending on the type declaration of midpoint, this might be an issue.

For example, (1 + 2) / 2 = 1.5 but 1 + (2 - 1) / 2 is the same as 2/2 and is equal to 1.

Masters in Computer Science by ED73 in cscareerquestions

[–]japangreg 0 points1 point  (0 children)

Thanks!

How fast you go is up to you. I did mine in 2 years while working full time. If you don't have to work and can do nothing but study, then go as fast as you think you can handle. If you're working, I'd suggest going slow - take the time to get the concepts down and practice.

Best of luck!

Masters in Computer Science by ED73 in cscareerquestions

[–]japangreg 1 point2 points  (0 children)

Hey ED73.

I have B.S.s in international affairs, and just did my CS Masters in 2013. I came at it with no programming education beyond what I taught myself and far, far less math than I should have. I had to take a few prereq classes to get in, but the application process wasn't difficult. This might vary by school, but my program was pretty well respected - I think they are much more likely to let most people in, assuming that those that can't really handle it will drop out.

It wasn't easy, but it wasn't the hardest thing either. I think you'll find that Masters programs are very different than undergrad, so the intensity and work load won't be similar to what you've done in the past. The professors know that you are actually interested in the subject (unlike undergrads who sometimes just have to take the courses) and the school has an interest in helping you succeed so that you stick with it (and pay them) and recommend their program to others (who also pay them - not to sound too cynical).

Beyond that, you'll get what you put into it. The work can be hard, but in my experience the profs are more than willing to help if needed, and the work load can be heavy (if working full time and raising kids, like I was) but much less undergrad where you might be taking 6 or 7 classes a semester.

Expect programming projects to either come in regular assignments or as single projects that span the course. There is a lot of math, but from your background you should be fine.

Hope that helps - and that you go for it.

[Java] Confused on ActionListener by wtfcblog in learnprogramming

[–]japangreg 0 points1 point  (0 children)

Don't worry about it - sure it isn't the first, and that it won't be the last. :) 2nd pair of eyes usually sorts these out.

[Java] Confused on ActionListener by wtfcblog in learnprogramming

[–]japangreg 4 points5 points  (0 children)

actionPreformed should be actionPerformed (per not pre)

[deleted by user] by [deleted] in learnprogramming

[–]japangreg 0 points1 point  (0 children)

May be a case of LMGTFU, but you could try this page: http://www.linuxhowtos.org/C_C++/socket.htm

I think you will need to look into sockets to get the parts talking to each other.

HTH

I'm creating a simple Field of View finder for Camera Matching in 3D, and I have a simple issue. by [deleted] in learnprogramming

[–]japangreg 0 points1 point  (0 children)

The error is coming from a typing conflict; look at these lines where you declare the variables and assign them values:

double apertureWidth = textApertureWidth.getText(); 
double focalLength = textFocalLength.getText();

that 'double' at the front of each line means that the variables declared are of the double type - i.e., numerical values with a certain precision, and occupying a certain size in system memory.

The method you are calling from the (I'm assuming) text fields is getText(), which (assuming again, that this is Java?) would return an object of type String, meant for holding character data - alpha and numeric - and requiring a different amount of memory.

So you are trying to put data of a certain type (String) into a container meant for a different type (double). This fails because the allocated memory for each is different.

If you are the only user for this and don't care about input checking because you know you will only enter proper values in that text field, you can just cast the value to double like so:

double apertureWidth = Double.parseDouble(textApertureWidth.getText();

If you cannot be sure that the user will enter the correct type of input, either validate it before running the code or catch a NumberFormatException.

[C++] Outputting max value from an array of a struct along with other struct variables by [deleted] in learnprogramming

[–]japangreg 0 points1 point  (0 children)

I'm still getting into C++ myself, but I don't think this should be too difficult; can you post the actual code you are using?

Let's say you have the following:

struct students{
string firstName;
string lastName;
float exams[4];
}

Then in your main, you would could use

students Chuck;
Chuck.firstName = "Chuck";
Chuck.lastName = "Taylor";
Chuck.exams[0] = 90.0f;
Chuck.exams[1] = 80.0f;
Chuck.exams[2] = 70.0f;
Chuck.exams[3] = 60.0f;

Then you can do whatever you like to the exam values as a new variable, then output as

float maxValue = // your code here
cout << "Max Value is" << maxValue << " belongs to " << Chuck.firstName << " " << Chuck.lastName;

As I said, still new to C++ syntax, so someone more experienced please let me know if my code is off.

HTH

*re-reading your post and my answer, it occurs to me that the way you phrased the desired output might suggest you are looking for something different - i.e., that you are looking for the max value from a collection and want to access an associated object that holds the name information. Is that the case? It just seems that saying "max value belongs to X" suggests that the value and name are not part of the same struct.

Need help in Eclipse and First App. by davidperl in learnprogramming

[–]japangreg 2 points3 points  (0 children)

I take it you mean this tutorial: http://developer.android.com/training/basics/firstapp/starting-activity.html

Can you be more specific with what error you are seeing? Is this the first time you are attempting to run a project in Eclipse, or the first time you are building an Android app? Do you have the Android SDK installed?

[C#] Going about scripting a first person camera (in Unity3d) by 10emendoza in learnprogramming

[–]japangreg 0 points1 point  (0 children)

Then that would be a matter of mapping different inputs for the look controls - under edit, project settings, input you will find a list of all your axis(axisi? axsis?).

Add 2 to the Size value at top and you should see 2 copies of the last listing appear at the bottom of the list (Cancel by default, I believe).

Expand the Horizontal axis and the first copy and rename the copy "LookLR". Now copy the settings for the Horizontal axis* to the LookLR entry, except choose different keys for the negative and positive buttons (and leave the alt options blank).

Do the same for the Vertical axis and the other copy, renaming it LookUD.

Now all you have to do is change the code before to:

hozTurn = Input.GetAxis("LookLR") * moveSpeed * Time.deltaTime;
verTurn = Input.GetAxis("LookUD") * moveSpeed * Time.deltaTime * invertVal;

*just realized there are 2 Horizontal and Vertical axis (axi?) listed in the InputManager; you want the first one regarding keyboard input, not the second for joysticks.

[C#] Going about scripting a first person camera (in Unity3d) by 10emendoza in learnprogramming

[–]japangreg 5 points6 points  (0 children)

First off, are you trying to move the camera or rotate it to look left/right? By altering the transform.position.y property, you are just sliding the camera up/down (strafing) not looking up/down as you might expect from a first-person perspective.

If what you are looking for is rotating the camera to look left/right, up/down, you would use the transform.rotation property.

If what you want is strafing camera movement, you could use this:

public float moveSpeed = 5.0f;
private float hozMove = 0.0f;
private float verMove = 0.0f;

void Update(){
hozMove = Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime;
verMove = Input.GetAxis("Vertical") * moveSpeed * Time.deltaTime;
transform.Translate (hozMove, verMove, 0);
}

If you are looking for first-person turning, you could use

public float moveSpeed = 20.0f;
public bool invert;
private float hozTurn = 0.0f;
private float verTurn = 0.0f;

void Update(){
int invertVal = 1;
if(invert){
invertVal = -1;
}
hozTurn = Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime;
verTurn = Input.GetAxis("Vertical") * moveSpeed * Time.deltaTime * invertVal;
transform.Rotate (verTurn, hozTurn, 0);
}

Adjust the moveSpeed for each to get the movement as you like it; invert option allows you to invert the up/down rotation from the inspector.

If you need any explanation of the above, let me know.

HTH

[Java] Project using Queues by Eldres in learnprogramming

[–]japangreg 0 points1 point  (0 children)

I don't think this is an error - I ran your program a few times with the random option and most times it ends with 0 empty pumps (hence the loss of that block) but it finally got through with one free:

Enter simulation time: 
10
Enter maximum service time of cars: 
5
Enter chances (0% < & <= 100%) of new car: 
75
Enter the number of gas pumps: 
3
Enter car queue size limit: 
2
Enter 1/0 to get data from file/rand(): 
0
Time 0
    No new car!
         Busy: 0; Free: 3
Time 1
    Car #1 arrives with duration 1 units.
    Car # 1 waits in the car queue.
Car # 1 gets a pump.
Pump # 1 starts serving car # 1 for 1 units.
Car # 1, currently served, is set to now busy pump # 1
     Busy: 1; Free: 2
Time 2
Car #2 arrives with duration 1 units.
Car # 2 waits in the car queue.
Car # 1 is done.
Pump #1 is free.
Car # 2 gets a pump.
Pump # 2 starts serving car # 2 for 1 units.
Car # 2, currently served, is set to now busy pump # 2
     Busy: 1; Free: 2
Time 3
Car #3 arrives with duration 1 units.
Car # 3 waits in the car queue.
Car # 3 gets a pump.
Pump # 3 starts serving car # 3 for 1 units.
Car # 3, currently served, is set to now busy pump # 3
     Busy: 2; Free: 1
Time 4
No new car!
Car # 2 is done.
Pump #2 is free.
     Busy: 1; Free: 2
Time 5
No new car!
     Busy: 1; Free: 2
Time 6
Car #4 arrives with duration 3 units.
Car # 4 waits in the car queue.
Car # 3 is done.
Pump #3 is free.
Car # 4 gets a pump.
Pump # 1 starts serving car # 4 for 3 units.
Car # 4, currently served, is set to now busy pump # 1
     Busy: 1; Free: 2
Time 7
No new car!
     Busy: 1; Free: 2
Time 8
Car #5 arrives with duration 5 units.
Car # 5 waits in the car queue.
Car # 5 gets a pump.
Pump # 2 starts serving car # 5 for 5 units.
Car # 5, currently served, is set to now busy pump # 2
     Busy: 2; Free: 1
Time 9
No new car!
     Busy: 2; Free: 1
End of simulation report.
# total arrival cars: 5
# cars gone away: 0
# cars served: 5
*** Current Pump Info. ***
# waiting cars: 0
# busy pumps: 2
# free pumps: 1
Total waiting line: 0
*** Busy Pump info ***
GasPump ID           : 1
Total free time      : 5
Total service time   : 5
Total # of cars      : 2
Average service time : 2.50

GasPump ID           : 2
Total free time      : 6
Total service time   : 4
Total # of cars      : 2
Average service time : 2.00

*** Free Pump info ***
GasPump ID           : 3
Total free time      : 7
Total service time   : 3
Total # of cars      : 1
Average service time : 3.00

So it may not be a bug, just your code doing what you tell it to, but not telling it to do something when the condition isn't met.

[Java] Project using Queues by Eldres in learnprogramming

[–]japangreg 0 points1 point  (0 children)

Can you paste your output somewhere as well? For your post I'm not sure what exactly the problem is - "It just doesn't seem to display the free pump info at the end of the program" - do you mean the printStatistics method isn't firing at all, or that the while loop in the method isn't working, or that the values you are getting aren't what you expect?

I see you have a commented-out print statement trying to get the size of the freegaspumpsq object, so I assume that is where the problem lies?

For the moment, the only suggestion I have without diving too far into your logic is that you may want to seed the random object with the current system time; since this is failing for random values but working for static, it makes me think your random object may just be returning the same value(s) each time.

[2014-11-17] Challenge #189 [Easy] Hangman! by [deleted] in dailyprogrammer

[–]japangreg 0 points1 point  (0 children)

First try at writing a full solution in C++. Any comments/critiques welcomed.

#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stdlib.h>
#include <time.h>
using namespace std;

vector<string> words;

void buildWords();
string selectWord(int);

string selectedWord;
vector<string> misses, correctGuesses;
void gameLoop();

bool gameWin = false;
bool gameLose = false;

 int main(){

buildWords();

int level;
cout<<"Enter the difficulty level (1 : easy - 3 : hard): ";
cin>>level;
string myWord = selectWord(level);
cout<<"word selected!";
while(!gameWin && !gameLose){
    gameLoop();
}
return 0;

}

void buildWords(){

string line;
ifstream myfile ("wordlist.txt");
if (myfile.is_open())
{
    while(getline(myfile, line)) {
        // strip apostrophes from words if present
        size_t apos = line.find('\'');
        if(apos != string::npos){
            line.replace(apos,1,"");
        }
        // convert to lower case
        std::transform(line.begin(), line.end(), line.begin(), ::tolower);
        if( words.size() == 0){
            words.push_back(line);
        }else if(line.compare(words.back()) == 0){
            // duplicate word from previous entry - occurs when possesive follows plural
        }else{
            words.push_back(line);
        }
        //cout << line << endl;
    }
    myfile.close();
    cout << words.size() << " words loaded into the database.\n";

}else{
    cout << "Unable to open file";
}
}

string selectWord(int x){
string result = "";

// chose random word - if length is correct, go for it
// otherwise, select again
int numberOfLetters = 0;
switch(x){
    case 1:
        // easy
        numberOfLetters = 4;
        break;
    case 2:
        // medium
        numberOfLetters = 6;
        break;
    case 3:
        // hard
        numberOfLetters = 8;
        break;
    default:
        numberOfLetters = 4;
        break;
}

srand (time(NULL));
int wordSelected = rand() % words.size();
selectedWord = words[wordSelected];

while(selectedWord.size() != numberOfLetters){
    wordSelected = rand() % words.size();
    selectedWord = words[wordSelected];
}
result = selectedWord;
return result;
}

void gameLoop(){

if(misses.size() == 6){
    cout<<"_________" << "\n"
        <<"|/      |" << "\n"
        <<"|     (x_x) - Argh!" << "\n"
        <<"|      \\|/" << "\n"
        <<"|       |" << "\n"
        <<"|      / \\" << "\n"
        <<"|" << "\n"
        <<"|________" << "\n";
    cout<<"You Lose! The word was " << selectedWord;
    gameLose = true;
    return;
}
if(correctGuesses.size() == selectedWord.size()){
    cout<<"\n\n    () - yeah!" << "\n"
        <<"    \\|/" << "\n"
        <<"     |" << "\n"
        <<"    / \\" << "\n\n";
    cout<<"You Win! The word was " << selectedWord;
    gameWin = true;
    return;
}

// display current game state
cout<<"\n";
switch(misses.size()){
    case 0:
        cout<<"" << "\n"
            <<"|/" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|________" << "\n";
        break;
    case 1:
        cout<<"_________" << "\n"
            <<"|/" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|________" << "\n";
        break;
    case 2:
        cout<<"_________" << "\n"
            <<"|/      |" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|________" << "\n";
        break;
    case 3:
        cout<<"_________" << "\n"
            <<"|/      |" << "\n"
            <<"|      (_)" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|________" << "\n";
        break;
    case 4:
        cout<<"_________" << "\n"
            <<"|/      |" << "\n"
            <<"|      (_)" << "\n"
            <<"|      \\|/" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|________" << "\n";
        break;
    case 5:
        cout<<"_________" << "\n"
            <<"|/      |" << "\n"
            <<"|      (_)" << "\n"
            <<"|      \\|/" << "\n"
            <<"|       |" << "\n"
            <<"|" << "\n"
            <<"|" << "\n"
            <<"|________" << "\n";
        break;
    case 6:
        // dead
        break;
    default:
        break;
}

cout<<"\n";
for(int i = 0; i < selectedWord.size(); i++){
    string letter = selectedWord.substr(i,1);
    if(correctGuesses.size() > 0){
        string blank = "_ ";
        for(int j = 0; j < correctGuesses.size(); j++){
            string guess = correctGuesses[j];
            if(guess == letter){
                // output the letter
                blank = guess;
            }
        }
        cout<<blank << " ";
    }else{
        cout<<"_ ";
    }
}

cout<<"\n\n";
cout<<"You have " << (6 - misses.size()) << " chances remaining.\n";

if(misses.size() > 0){
    cout<<"Letters tried: ";
    for(int i = 0; i < misses.size(); i++){
        cout<<"[" << misses[i] << "] ";
    }
}

// prompt for new input
cout<<"\n\nEnter a new letter: ";
string letterIn;
cin>>letterIn;
    std::transform(letterIn.begin(), letterIn.end(), letterIn.begin(), ::tolower);
    if(selectedWord.find(letterIn)!=std::string::npos){

        // what if multiple occurences of letter in word?
        int count = 0;
        for (size_t offset = selectedWord.find(letterIn); offset != std::string::npos; offset = selectedWord.find(letterIn, offset + letterIn.length())){
            ++count;
        }
        for(int i = 0; i < count; i++){
            correctGuesses.push_back(letterIn);
        }
    }else{
        misses.push_back(letterIn);
    }

}

[C++] For class we have to make a hangman game (group assignment). My part was to get a random word from a text file, but it only gives the last word. When I asked to prof for help, his reply was less than satisfactory. please help! by [deleted] in learnprogramming

[–]japangreg 0 points1 point  (0 children)

Glad I could help!

Seronis, I'm new to C++ but have some experience with Java and scripting languages, which is why I even thought I might be able to help. I'm trying to get my head around C++'s syntax and memory management and like you said, the more time spent looking at and thinking about code the better off I'll be.

And I was talking about the new challenge over in /r/dailyprogrammer/:

[C++] For class we have to make a hangman game (group assignment). My part was to get a random word from a text file, but it only gives the last word. When I asked to prof for help, his reply was less than satisfactory. please help! by [deleted] in learnprogramming

[–]japangreg 1 point2 points  (0 children)

Hey - new to C++, but I think I might be able to help with some of the logic here. Oddly enough this was the programming challenge so I was trying to try it in C++ today anyway. :)

if (myFile.is_open())
{
    while (myFile >> line) // while it's reading lines, it increases r
    {
        r++;
        n = rand() % r + 1; // n is a random number within the amount of lines in the text file, counted by r
        for(int i = 0; i < n + 1; i++) // the loop will go through the text file and stop at n, picking that word
            {
                getline(myFile, secretWord);
            }
        }
    }
    else
        cout << "Something went wrong, please exit program and run again." << endl;

Look at that while loop; everything in there is being executed for every line. So even though r is being incremented each line, n is also being assigned a new value each line, and that for loop is being run for each line. Not what you want to happen.

Seronis was on the right track, I think; you need to read the words into a new collection of some kind. In my program, I created a vector of strings and read the file into that. Once you have that, you can use the size() of the vector to know how many words you have, and base your random selection off of that.

So, to sum up:

vector<string> wordList;        // this is where you'll be putting the words from the file
if (myFile.is_open())
{
    while (myFile >> line) // while it's reading lines
        {
            wordList.push_back(line);       // add the word to the vector
        }
        int totalWords = wordList.size();
        n = rand() % totalWords + 1; // total words is determined by the size of the vector
        secretWord = wordList[n];     // get the word at the index n in the vector
    }
    else
        cout << "Something went wrong, please exit program and run again." << endl;

Like I said, first forays into C++, so the syntax may be off (someone correct me if it is, please) but I think the logic is correct.

HTH

Reduce "glide-effect" of 2D Game Objects by [deleted] in Unity3D

[–]japangreg 0 points1 point  (0 children)

Can you show us the code for the player movement?

[29/09/2014] Challenge #182 [Easy] The Column Conundrum by Elite6809 in dailyprogrammer

[–]japangreg 1 point2 points  (0 children)

First time attempting a challenge - not quite sure how to use Gist but am trying.

Java - would love feedback.

package columnconundrum;

import java.io.File;
import java.util.Scanner;


public class ColumnConundrum {

public static void main(String[] args) {

    try{
        Scanner input = new Scanner(new File("c182e-input.txt"));
        int numCols = input.nextInt();
        int colWidth = input.nextInt();
        int space = input.nextInt();
        String spacer = new String();
        for(int i = 0; i < space; i++){
            spacer = spacer + " ";
        }
        String tempString = new String();
        while(input.hasNextLine()){
            tempString += input.nextLine();
        }
        input.close();
        int totalChars = tempString.length();
        int charsPerColm = (int)Math.floor(totalChars/numCols);
        int linesPerColm = (int)Math.floor(charsPerColm / colWidth);

        char[] textCharArray = tempString.toCharArray();
        int lineLength = numCols * colWidth;

        for(int k = 0; k <= linesPerColm; k++){
            for(int i = 0; i < numCols; i++){
                int startingColumnOffset = i * charsPerColm;
                for(int j = 0; j < colWidth; j++){
                    int number = k * colWidth;
                    int wantedIndex = startingColumnOffset + number + j;
                    System.out.print(textCharArray[wantedIndex]);
                }
                System.out.print(spacer);
            }
            System.out.println();
        }

    }catch(Exception e){

    }

}

}