JohnMatt

- friends
1,172 link karma
3,227 comment karma
send messageredditor for
what's this?

TROPHY CASE

Growing Up by mocotazoin aww

Hans Rosling had a question: Do some religions have a higher birth rate than others -- and how does this affect global population growth? by feureauin Foodforthought

[–]JohnMatt 0 points1 point ago

This. His talks are always great, entertaining, and I always learn something.

Unfamiliar measurements in US recipes by fruntin Cooking

[–]JohnMatt 1 point2 points ago

Is that 70 oz. weight or volume?

Advice needed - per chopping onion and garlick by cppoin Cooking

[–]JohnMatt 0 points1 point ago

I'm thinking it's the time spent while "away" that matters here. I.E. taking time away from other activities while on vacation or whatever.

Is there a list of all legal chess moves per piece? by danger_onein chess

[–]JohnMatt 3 points4 points ago

I'd tell the user it isn't legal. Imagine being new to chess, and trying to jump a piece, and suddenly you've instead captured the piece. You'd likely think it was a bug in the software.

Hey chessit, what would you recommend as the best literature for a newb to read? by bfkillin chess

[–]JohnMatt 0 points1 point ago

I know you asked for a book, but I think the Chessmaster computer program has a very good learning system to it. It'll take you through the basics of how pieces move, then move into basic attacking ideas by only having a few pieces on the board, and then progressively move into full games and the principles of the game.

It's like learning how to play baseball. Would you take a five year old and throw them onto a diamond as part of an adult team? No, you'd first teach them what a baseball is, and how to throw it. And what a glove is, and how to use it. And what a bat is, and how to swing it. Once you have those elements, then you can start talking about how to play baseball and the rules of the game.

Is there a list of all legal chess moves per piece? by danger_onein chess

[–]JohnMatt 1 point2 points ago

Hah. I just posted a similar plan, except I used a bishop as an example. You beat me to it.

I really think this is the only way to go. A database would require a full 384 lists, by my math. One list per piece type per starting square. Actually, more than that, because the pawn lists need to differentiate between piece color.

Is there a list of all legal chess moves per piece? by danger_onein chess

[–]JohnMatt 4 points5 points ago

I don't think that technique is going to work, and would take quite a long time. What you need to do instead is have some kind of logic test based on the way the pieces move.

So for example, let's take the bishop. Each square would have to be identified by the row and column it is in. Number the columns 0 - 7 (or 1 - 8 if you like) from left to right, and the rows 0 - 7 (or 1 - 8) from top to bottom. So the top left square is 0,0, and the bottom right square is 7,7.

Then, the user attempts to make a move. You would have some function, let's call it Is_Move_Legal, that would first determine which type of piece is trying to move, then determine if the move was legal for that piece. It determines the piece is a bishop. The logic test for a bishop would be something like

if(abs(initial_row-final_row)=abs(initial_column-final_column), true, false)

What's happening here? You're basically determining how many columns the bishop moved (by subtracting the initial from the final and then taking the absolute value of that), and how many rows it moved (same process). A bishop moves diagonally. So, on any legal move, it will move an equal number of rows as columns, and the reverse is true: if the bishop moves an equal number of rows as columns, the move is legal.

Note that the "row" and "column" values would likely be assigned to the squares as opposed to the pieces. The "squares" will have to exist in your code for display purposes anyway, so you may as well use them in your game code. So the above logic test for a bishop would be retrieving those values from the squares that the bishop started and is attempting to end on.

Now, remember. You also need your function to check to see if the bishop illegally jumped over an enemy or friendly piece, is illegally trying to occupy the same square as a friendly piece, or if the move would illegally put or leave the user's king in check. But in terms of a piece's moving pattern, I think the above is the best method. Your method would require a different list of legal moves for each square that the piece may occupy.

Finally, note that I've only ever taken one computer science class, and it was a number of years ago, in Java. So there may be more elegant/simple solutions available that I don't know of.

-edited for spelling-

Derren Brown plays 9 simultaneous chess games against 9 chess masters (4 of which are GMs). He wins 5 out of 9 games by using a clever trick of the mind. by haddock420in chess

[–]JohnMatt 0 points1 point ago

If I had to guess, I'd say it's at least moderately possible for one of the other games to have had a similar if not identical opening, from which he could copy one of the other players, and hopefully come out of the opening with an edge.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 2 points3 points ago

Brodeur makes shaft stops, Henrik makes head stops.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 0 points1 point ago

Nobody on either team can complete a pass right now.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 1 point2 points ago

I don't think neither I nor the Rangers could survive that.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 0 points1 point ago

"Marty," and also "uncle Daddy," because Brodeur cheated on his wife with her sister.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 0 points1 point ago

Would be an incredibly weak interference call though, that was my point.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt -2 points-1 points ago

Only against each other. The first line would tear either fourth line apart.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 0 points1 point ago

Surprised they didn't get matching minors there.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 1 point2 points ago

Thought it was called interference. I can see that as boarding.

PLAYOFF GAME THREAD: ECF; New Jersey Devils (#6) vs New York Rangers (#1) Game #5 (8:00 ET) - Series is Tied 2-2 by seKer82in hockey

[–]JohnMatt 0 points1 point ago

Difference is, Rangers hockey isn't boring as all fuck.

The trap was based on preventing any offensive chances period. Rangers defense (a la shotblocking) is based on cutting the chance short once it occurs.

view more: next