what cpu should i buy intel i7-8700k or ryzen 7 1700x

Solution
1700 is best bang for the money since you can overclock it to perform similar to 1700X or close to 1800X. However, if you don't like OCing, either 1700X or 1800X will do.
If you OC, I'd go for the 8700K. Even both CPUs overclocked, the 8700k's 6 cores can match Ryzen's 8 cores due to clockspeed and IPC in most benches I've seen. Still, for the cost, the Ryzen is hard to beat depending on your budget. If you go with Ryzen and OC, stick with 1700 instead of X version unless same price. Saw Newegg had 1700 for $295 and 1700X for $299 a week ago or so. On side note, I have a 1700 system I tested and it goes to 3.85Ghz stable with a safe voltage.