Search found 25 matches

by jhaglund2
Wed Jul 26, 2017 7:54 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: when is a move a blunder?
Replies: 15
Views: 2234

Re: when is a move a blunder?

Hi, When is a move a blunder? How can I programmatically find this? ChessArtist calls a move a blunder if the score goes down 1,5 pawn. But that doesn't always apply, does it? If all other moves have scores even lower, than the chosen 1,5 pawn is not a blunder is it? Maybe a better question would b...
by jhaglund2
Fri Jul 07, 2017 2:13 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need help with C++ sorting file data
Replies: 15
Views: 2682

Re: Need help with C++ sorting file data

Thank you for the help. I appreciate it!
by jhaglund2
Sun Jul 02, 2017 5:18 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need help with C++ sorting file data
Replies: 15
Views: 2682

Re: Need help with C++ sorting file data

I wrote this last night, before seeing Patrik's code. Apparently it's a very natural way to do it. #include <iostream> #include <sstream> #include <string> #include <vector> #include <algorithm> int main() { std::vector<int> v; std::string line; while (std::getline(std::cin, line&#...
by jhaglund2
Sun Jul 02, 2017 5:06 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need help with C++ sorting file data
Replies: 15
Views: 2682

Re: Need help with C++ sorting file data

#include <algorithm> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> int main() { std::ifstream data("data.txt"); std::string line; std::vector<int> v; while (std::getline(data, line)) { v.clear(); std::istringstream pa...
by jhaglund2
Sun Jul 02, 2017 6:58 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need help with C++ sorting file data
Replies: 15
Views: 2682

Re: Need help with C++ sorting file data

This seems like more of a Stackoverflow question than a Talkchess question... It looks more like a homework question than anything else, actually. In Perl: perl -ane 'print join " ", (sort {$a<=>$b} @F), "\n"' No, not homework, just a personal project that I've been stuck on for y...
by jhaglund2
Sun Jul 02, 2017 6:53 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need help with C++ sorting file data
Replies: 15
Views: 2682

Re: Need help with C++ sorting file data

AndrewGrant wrote:This seems like more of a Stackoverflow question than a Talkchess question...
Thanks for the suggestion. I will look into that site.
by jhaglund2
Sun Jul 02, 2017 6:51 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need help with C++ sorting file data
Replies: 15
Views: 2682

Re: Need help with C++ sorting file data

elcabesa wrote:I really don't understood what is the question.
Need to sort each line in the text file from smallest to largest. The above is what I have so far.
by jhaglund2
Sun Jul 02, 2017 5:50 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need help with C++ sorting file data
Replies: 15
Views: 2682

Need help with C++ sorting file data

I'm looking for some help with sorting information taken from a file. Example: data.txt 10 3 41 12 1 23 12 34 22 3 32 3 30 2 12 output: 1 3 10 12 41 3 12 22 23 34 2 3 12 30 32 int parse() { lines(); int max = 5 * numLines; std::string line; int log[max]; ifstream data ("data.txt"); std:...
by jhaglund2
Tue Mar 14, 2017 1:47 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Satus of 7 men?
Replies: 7
Views: 1622

Re: Satus of 7 men?

I would rather have GBytes of position learn, with format: FEN - bm ply score generate by the engine itself. Crafty v25.4 would have this if it were up to me. I did mentioned something like it before. Take all the ECO openings, At the end of each variation, learn each position searched, optional set...