Bet whatever you're doing... | xltronic messageboard
 
You are not logged in!

F.A.Q
Log in

Register
  
 
  
 
(nobody)
...and 103 guests

Last 5 registered
Oplandisks
nothingstar
N_loop
yipe
foxtrotromeo

Browse members...
  
 
Members 8025
Messages 2613457
Today 3
Topics 127500
  
 
Messageboard index
Bet whatever you're doing...
 

offline Ceri JC from Jefferson City (United States) on 2002-05-02 16:33 [#00203564]
Points: 23533 Status: Moderator | Show recordbag



...isn't as laborious as this:

I have to write a program that calculates every legal chess
move for all pieces- however, the language isn't
particularly bright, so I have to manually type out all the
possible co-ordinates manually...

No thought involved, but I have to do it or I'll fail this
module :(


 

offline jonesy from Lisboa (Portugal) on 2002-05-02 16:35 [#00203568]
Points: 6650 Status: Lurker



Can't you employ some valleys white trash nipper and pay 'em
50p an hour to do it for you?


 

offline wizards teeth from Newcastle (United Kingdom) on 2002-05-02 16:36 [#00203571]
Points: 1070 Status: Regular



someone once told me that after nine moves on a chess board
there are move possible positions than electrons in the
universe


 

offline mofo from glasgow (United Kingdom) on 2002-05-02 16:52 [#00203605]
Points: 97 Status: Lurker



im here to hide from work.


 

offline Ceri JC from Jefferson City (United States) on 2002-05-02 16:56 [#00203611]
Points: 23533 Status: Moderator | Followup to wizards teeth: #00203571 | Show recordbag



Exactly, that's why it's taking so long to do...

Jonesy: I would, but the proles around here haven't been
influenced enough by our russian comrades to play chess yet,
so they'd probably mess it up :)


 

offline jonesy from Lisboa (Portugal) on 2002-05-02 16:57 [#00203614]
Points: 6650 Status: Lurker | Followup to Ceri JC: #00203611



Quite. Catch you tomorrow.


 

offline Laserbeak from Netherlands, The on 2002-05-02 16:58 [#00203619]
Points: 2670 Status: Lurker



Isn't the whole point of doing that to use mathmatical
equations so you don't have to type all the coordinates?
Just a thought, I can't program at all...


 

offline xlr from Boston (United States) on 2002-05-02 16:59 [#00203621]
Points: 4904 Status: Regular



Math is hard.

I'm writing a term paper on Otto Von Bismarck and it's very
upsetting.


 

offline Ceri JC from Jefferson City (United States) on 2002-05-02 17:03 [#00203624]
Points: 23533 Status: Moderator | Followup to Laserbeak: #00203619 | Show recordbag



I know, in "normal" languages you could use a "FOR LOOP" to
work out the various permeatations- however the language I
have to do it in (PROLOG) doesn't support this! And this is
the language used for most AI programming in games...


 

offline Ceri JC from Jefferson City (United States) on 2002-05-02 17:35 [#00203661]
Points: 23533 Status: Moderator | Show recordbag



Finally finished it!

273 lines of code in total,
here are some choice Highlights:

square(0,0).
square(0,1).
square(0,2).
square(0,3).
square(0,4).
square(0,5).
square(0,6).
square(0,7).
square(1,0).
square(1,1).
square(1,2).
square(1,3).
square(1,4).
square(1,5).
square(1,6).
square(1,7).
square(2,0).

knightmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,1)),is(W,+(Y,2)).

knightmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,1)),is(W,-(Y,2)).

knightmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,2)),is(W,+(Y,1)).

knightmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,2)),is(W,-(Y,1)).

%Right
rookmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,0)),is(W,+(Y,1)).
rookmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,0)),is(W,+(Y,2)).
rookmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,0)),is(W,+(Y,3)).
rookmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,0)),is(W,+(Y,4)).
rookmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,0)),is(W,+(Y,5)).
rookmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,0)),is(W,+(Y,6)).
rookmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,0)),is(W,+(Y,7)).

%Moves for Queen

/*I think that there may be a more efficient way of doing
this, by checking if the move is either a valid rook or
bishop
move. This would eliminate duplication of code. As it is, I
just copied and pasted the already tested Bishop and rook
code
and changed the names.*/

%Diagonally Up-Right
queenmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,1)),is(W,+(Y,1)).
queenmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,2)),is(W,+(Y,2)).
queenmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,3)),is(W,+(Y,3)).
queenmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,4)),is(W,+(Y,4)).
queenmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,5)),is(W,+(Y,5)).
queenmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,6)),is(W,+(Y,6)).
queenmove(X,Y,V,W) :-
square(X,Y),square(V,W),is(V,+(X,7)),is(W,+(Y,7)).

^Can you see what I meant ;)


 

offline Narkotic from United States on 2002-05-02 17:39 [#00203664]
Points: 667 Status: Regular



NEERERRRRRRDDDSSSSS

NERDS NERDS NERDS NERDS NERDS NERDS NERDS NERDS


 

offline Loogie from Oxford (United Kingdom) on 2002-05-02 17:40 [#00203665]
Points: 1371 Status: Lurker



I pity you. Software Development is the reason I didn't
complete my degree. I'm not mathematically minded


 

offline Narkotic from United States on 2002-05-02 17:41 [#00203666]
Points: 667 Status: Regular



than you should envy him, rather than pity him you mongoloid


 

offline Loogie from Oxford (United Kingdom) on 2002-05-02 17:46 [#00203668]
Points: 1371 Status: Lurker



stop flirting prettyboy and get some sun


 

offline Ceri JC from Jefferson City (United States) on 2002-05-02 17:51 [#00203670]
Points: 23533 Status: Moderator | Followup to Loogie: #00203668 | Show recordbag



LOL @ Loogie.

Narkotic: I don't see how programming makes you a Nerd.
That's a bit of a stereotype. Are you calling the admin here
nerds? ;)


 

offline Ceri JC from Jefferson City (United States) on 2002-05-02 18:47 [#00203711]
Points: 23533 Status: Moderator | Show recordbag



Man, now I have to do a family tree program that given a
list of people and their family calculates which people may
marry...

...this is much harder. I'm tempte just to say they're all
red necks/aristocracy/people from the valleys and hence
marry anyone regardless of blood ties.


 

offline xlr from Boston (United States) on 2002-05-02 18:50 [#00203712]
Points: 4904 Status: Regular



I'd kill myself if I had to write code for a living :)

I'd rather just design on computers.


 

offline Ceri JC from Jefferson City (United States) on 2002-05-02 18:54 [#00203717]
Points: 23533 Status: Moderator | Followup to xlr: #00203712 | Show recordbag



Me too, I'm not a bad programmer by any means, and I can see
the mathematical beauty of programming- it's just that I
don't enjoy it the way some people seem to.

Also I forsee the next generation of programming languages
(that'll probably come out after the next big breakthrough
in chips- and hence processing power) negating
"conventional" coding. So I can't be bothered to spend hours
learning to code at the moment.

I just do the minimum to get by in programming for my
degree- I far prefer creating something on a computer using
existing programs like level designers, music software or 3d
packages etc.


 

offline Inverted Whale from United States Minor Outlying Islands on 2002-05-02 19:00 [#00203725]
Points: 3301 Status: Lurker



Writing code is fun (er for most languages, not COBOL for
instance), but it takes a certain type, I can easily see how
it could drive some people insane.


 


Messageboard index