Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pattern Problems

 
Eden Landau
Ranch Hand
Posts: 40
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There seems to be a problem in my pattern, though I can't seem to find it. Any help?

 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12097
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you think there is a problem? Does this compile? Does it run? Does it not match something you think it should? Does it match something you think it shouldn't? What would that be?

you haven't given us near enough information to even attempt to help you.
 
Winston Gutkowski
Bartender
Pie
Posts: 10226
58
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eden Landau wrote:There seems to be a problem in my pattern, though I can't seem to find it. Any help?


Fred's quite right, but just hazarding a guess, I'd say that your '+'s are misplaced.

Do you actually want to match the character '+'? Because that's what you're doing.

Winston
 
Eden Landau
Ranch Hand
Posts: 40
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would explain, then. Where should I put the +'s?
 
Eden Landau
Ranch Hand
Posts: 40
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, this is the error the compiler gives me:

Exception in thread "main" java.lang.NullPointerException
at Console.validateString(Console.java:43)
at Console.analyzeString(Console.java:20)
at Console.toNumber(Console.java:230)
at DiceRoll.main(DiceRoll.java:21)
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not a compiler error, that's a runtime exception. And the exception tells you exactly where to look - something on line 43 of Console.java is null but you're still trying to access it.
 
Eden Landau
Ranch Hand
Posts: 40
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I figured that part out, and solved it. Thanks for everyone's help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic