• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

eight Move q that use OO

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need help with the legal move of 8 q, i need some ideas or brainstorm about moving the q from 2 diagonal (left and right) and we don't care about the bottom part.
this what i got so far :

 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Andres John wrote:I need help with the legal move of 8 q, i need some ideas or brainstorm about moving the q from 2 diagonal (left and right) and we don't care about the bottom part.
this what i got so far :


What, exactly, do you need help with? compiling this? running this? is it doing something you don't expect? If so, what DOES it do, and what do you EXPECT it to do?

I don't see an actual question anywhere, so nobody has any idea how to help you.
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

fred rosenberger wrote:

Andres John wrote:I need help with the legal move of 8 q, i need some ideas or brainstorm about moving the q from 2 diagonal (left and right) and we don't care about the bottom part.
this what i got so far :


What, exactly, do you need help with? compiling this? running this? is it doing something you don't expect? If so, what DOES it do, and what do you EXPECT it to do?

I don't see an actual question anywhere, so nobody has any idea how to help you.



i guess i need help with the compile and i was expecting the queen to backtracking, the solution requires that no two queens share the same row, column, or diagonal by checking the first row
 
fred rosenberger
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so...if you need help with compiling, tell us what happens when you do the "javac Queen8Moves.java" command?
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the error
 
fred rosenberger
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok...so fix that. it tells you exactly what the problem is.

On line 21, you call the legal() method, and pass it two int variables:


However, the only place you define the legal method, you say it takes THREE int variables:


The compiler is telling you that something isn't right. You either need to:
a) change the call on line 21 to pass in three arguments
b) define a new legal() method that takes two int parameters
c) change the existing legal() method to only take two - this would then require you to change any other calls to the legal() method that currently pass in three arguments.

My guess is you would want to do a, but I haven't (and most likely won't) go through your 100 lines of code to try and figure that out.
reply
    Bookmark Topic Watch Topic
  • New Topic