This site requires Javascript to work properly. Please enable Javascript in your browser.
(check to search in 'Trends')
Log in
Cyberat
(3)
Posts
1 Posts
Moderating
0 Room
Posts
Comments
Fschmidt, to be more clear, you build a program for a machine printing custom lottery picks on a screen. Any lottery, so the input is user input not preset numbers not yours not anyone else's. You must have an input and verification process of such.
Fschmidt, explain where and how, I don't see it at all.
FSchmidt you did not follow the challenge, you followed Java Juggler's choice of 49, 6, 10. Must have USER INPUT, not your choice. Must validate input.
I can say Luan language has very weird For/Next loops.
Fschmidt, well done and complete code, but no Duplicate Checks. Must have duplicate check per game and per set of games. Best random(timer) will create duplicate numbers & duplicate games also. Maybe there is a language problem here let's say I have 5 numbers: 2, 34, 12, 44, 2. This pick is not desired. Also a game set should not repeat, same way. Run your program & test against it, run 10 games, run 20 games.
Took me about 3 days, take your time. Do run it and test it. Rule of thumb, run with 6 numbers per game and 10-12 games to look for duplicates. Don't trust the randomizer, correct it.
Hint, requires at least 3 nested loops for duplicate checks.
Input still faulty, since I hate Java and not that familiar, let me write your input in C# best I remember: Input ("What is the maximum number to have in a game ? :", max_number); While max_number =< 1 Print ("Invalid Number, must be greater than 1, try again."); Do Would need a set for each input.
Now you removed the check for duplicate numbers and have no check for duplicate games. This is the entire brain & core of the exercise.
I specified user picks amount of games and all that input, not programmer. Let me be clearer, I walk up to a machine that runs your program, the machine will ask me three questions: What is the max. number in the game, how many numbers to get for a game, how many games to get for this session. Runs the process and returns to main menu on key press. RUN YOUR OWN PROGRAM, test it, not just "I wrote this, how is it now ?".
Make it simpler, list the last number as "bonus number", just a header text print marking the column.
First of all put in the proper code for inputs and verification, you got it, just not in there. Also you don't want to invalidate ALL inputs for 1 wrong input, very annoying. Deprecate verification after each input.
Yes, it was a trick, sounds simple right, lottery picker ? I did it in C# and I ran into trouble seeing the results. Then I added the bonus as extra, when I solved it. I used Arrays and nested loops - hint.
I also asked for verification that games do not repeat in a batch. Yes, randomizer can do that in a set of 10+ games.
Does it run and perform ? I want the printed results. Cheap & easy way out, no text input or verification. Deprecate "Number not in game". It's almost like pseudo code. Nope you don't have it, incomplete work.
Cyberat
1713210742
Code challenge for you programmer
32 Comments
3