Skip to main content
added 105 characters in body
Source Link
toolic
  • 15.8k
  • 6
  • 29
  • 217

Overview

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

Portability

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

Instructions

When I ran the code, I ended up getting the message:

Illegal!
    Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

Input

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

Tabs

When I copied the code from your question into an editor, some of the indentation was inconsistent. I suspect (but I can not easily prove) that some lines of your code have both tab characters and single spaces. If that is the case, consider using just one or the other.

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

When I ran the code, I ended up getting the message:

Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

When I copied the code from your question into an editor, some of the indentation was inconsistent. I suspect (but I can not easily prove) that some lines of your code have both tab characters and single spaces. If that is the case, consider using just one or the other.

Overview

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

Portability

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

Instructions

When I ran the code, I ended up getting the message:

    Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

Input

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

Tabs

When I copied the code from your question into an editor, some of the indentation was inconsistent. I suspect (but I can not easily prove) that some lines of your code have both tab characters and single spaces. If that is the case, consider using just one or the other.

added 276 characters in body
Source Link
toolic
  • 15.8k
  • 6
  • 29
  • 217

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

When I ran the code, I ended up getting the message:

Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

When I copied the code from your question into an editor, some of the indentation was inconsistent. I suspect (but I can not easily prove) that some lines of your code have both tab characters and single spaces. If that is the case, consider using just one or the other.

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

When I ran the code, I ended up getting the message:

Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

When I ran the code, I ended up getting the message:

Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

When I copied the code from your question into an editor, some of the indentation was inconsistent. I suspect (but I can not easily prove) that some lines of your code have both tab characters and single spaces. If that is the case, consider using just one or the other.

added 49 characters in body
Source Link
toolic
  • 15.8k
  • 6
  • 29
  • 217

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

When I ran the code, I ended up getting the message:

Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions whenwhen the code is run, such as the name of the game, the objective of the game, etc.

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

When I ran the code, I ended up getting the message:

Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. That is pretty common for user input.

Generally speaking, the code layout looks good and you used meaningful names for variables, functions and classes.

That being said, it would be better to reduce the length of the 2 longest lines of code.

I got an error on the following line when I tried to compile the code:

            System.out.print(" ".repeat(space)); 

Perhaps I am running on a different version of Java. As a hack to get it to compile, I removed .repeat(space).

When I ran the code, I ended up getting the message:

Illegal!

It is good that the code reports an error, but it would be better if it also reported why it is an error and what I should do to correct my actions.

Along the same lines, it would be better to post a few more lines of instructions when the code is run, such as the name of the game, the objective of the game, etc.

It is great that you have code that checks user input. Consider allowing lowercase letters for the input: w in addition to W, d in addition to D, etc. Your code could convert all input to uppercase. That is pretty common for user input.

Source Link
toolic
  • 15.8k
  • 6
  • 29
  • 217
Loading