Anyone here good at coding in jbasic? Newfag coder here who could use some help making a program that will count between 1 and 2000 randomly with two different counters until both of them are at the same number at the same time. Thanks in advance
>Pic unrelated
And what shall happen if they never match?
>>224161
it would just keep going until it finds one
>>224161
I've seen them run and It usually doesn't take very long at all.
also,
>dubs
>>224176
Ahh now I see what you mean.
>>224158
Hey buddy I created a replica of the program you want to create. However I wrote it in C++. Maybe looking at my code could help you create yours? Concepts could be similar anyway.. here you are.
>>224269
This code would be much more elegantly written if you stripped out the stop var and simply did
while (counter1 != counter2)
>>224269
I'm pretty sure OP wants to (randomly) increment one counter or the other, then halt when a=b or a>2000 or b>2000
Also
>2016
>let's learn C++
At least use Swift, Rust or D.
>>224278
Or, used break instead of while(i_dont_know_what_break_does)
>>224301
>Swift, Rust or D
>Hurr Durr C++ is to mainstream therefore I program some exotic phantasy language.
Let's see how many job ads are looking for C++ skills and how many are looking for Rust skills
>>224305
I'ma guess "none", and "some".
Unless you're planning on writing the next Flash Player, C++ is old and busted. As a tool for teaching basic programming concepts in a thread like this, I'm not sure I could actually think of a worse language.
>>224307
This example just used a while loop and an if statement. In every serious programming language the solution would look almost the same. I don't see why C++ should be less suitable for this example than any other language.
>>224177
noice