Because Valve doesn't release their financial reports, it's tough to say what Valve would be worth, but Forbes apparently put it at 10 Bn. I know I'd buy Valve stock if it went public though...
If Nintendo can be worth forty somthing billion; Valve could be worth twenty billion, easy.
Like I said, we have no data on how much money Valve really makes, so it's tough to say. Nintendo on the other hand has enormous, still untapped, potential when it comes to leveraging their IPs to make money. They have just started getting their toes wet in the mobile market, once they dive in for full, and the money from the super succesfull Switch starts flowing in for completely, not to mention that they're about to start a subscriber based online service, they'll be making billions (plural) a year in profit. It's tough to say how Valve stacks up compared to that, because Valve is so tight lipped with their financials.