Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Education
Blinken
Commits
30588b37
Commit
30588b37
authored
Jul 23, 2020
by
Albert Astals Cid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port away from KRandom
parent
1382a024
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
CMakeLists.txt
CMakeLists.txt
+2
-2
src/blinkengame.cpp
src/blinkengame.cpp
+2
-5
No files found.
CMakeLists.txt
View file @
30588b37
...
...
@@ -9,8 +9,8 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project
(
blinken VERSION
${
RELEASE_SERVICE_VERSION
}
)
# minimal Qt requirement
set
(
QT_MIN_VERSION
"5.
9
.0"
)
set
(
KF5_MIN_VERSION
"5.
46
.0"
)
set
(
QT_MIN_VERSION
"5.
10
.0"
)
set
(
KF5_MIN_VERSION
"5.
55
.0"
)
# ECM
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
...
...
src/blinkengame.cpp
View file @
30588b37
...
...
@@ -9,11 +9,9 @@
#include "blinkengame.h"
#include <stdlib.h> // for RAND_MAX
#include <QRandomGenerator>
#include <QTimer>
#include <KRandom>
#include "soundsplayer.h"
blinkenGame
::
blinkenGame
()
:
m_phase
(
starting
)
...
...
@@ -152,11 +150,10 @@ void blinkenGame::nextRound()
blinkenGame
::
color
blinkenGame
::
generateColor
()
{
int
r
;
// make the compiler happy :-D
color
c
=
none
;
r
=
1
+
(
int
)(
4.0
*
KRandom
::
random
()
/
(
RAND_MAX
+
1.0
));
const
int
r
=
QRandomGenerator
::
global
()
->
bounded
(
1
,
5
);
// rand [1, 5)
switch
(
r
)
{
case
1
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment