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
Games
Bovo
Commits
c4e3660c
Commit
c4e3660c
authored
Mar 29, 2016
by
Frederik Schwarzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use C++ time instead of C time.
parent
b4bc132a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
ai/aron/aiboard.cc
ai/aron/aiboard.cc
+2
-2
ai/gabor/ai_impl.cpp
ai/gabor/ai_impl.cpp
+2
-2
ai/gabor/node.cpp
ai/gabor/node.cpp
+0
-1
No files found.
ai/aron/aiboard.cc
View file @
c4e3660c
...
...
@@ -25,7 +25,7 @@
#include "aiboard.h"
#include <time
.h
>
#include <
c
time>
#include <vector>
#include <iostream>
...
...
@@ -81,7 +81,7 @@ usi AiBoard::height() const {
Coord
AiBoard
::
move
()
{
if
(
m_cleanBoard
)
{
qsrand
(
static_cast
<
int
>
(
time
(
0
)));
qsrand
(
static_cast
<
int
>
(
std
::
time
(
nullptr
)));
usi
randX
=
qrand
()
%
(
m_dimension
->
width
()
/
3
)
+
m_dimension
->
width
()
/
3
;
usi
randY
=
qrand
()
%
(
m_dimension
->
height
()
/
3
)
+
m_dimension
->
height
()
/
3
;
return
Coord
(
randX
,
randY
);
...
...
ai/gabor/ai_impl.cpp
View file @
c4e3660c
...
...
@@ -27,7 +27,7 @@
#include <cstdlib>
#include <memory.h>
#include <assert.h>
#include <time
.h
>
#include <
c
time>
#include <stdio.h>
// hash table
...
...
@@ -45,7 +45,7 @@ AiImpl::AiImpl() : table_size_x(20), table_size_y(20),
{
if
(
!
rand_inited
)
{
rand_inited
=
true
;
qsrand
(
(
unsigned
int
)
time
(
NULL
));
qsrand
(
static_cast
<
unsigned
int
>
(
std
::
time
(
nullptr
)
));
}
memset
(
hashData
,
0
,
sizeof
(
hashData
));
}
...
...
ai/gabor/node.cpp
View file @
c4e3660c
...
...
@@ -25,7 +25,6 @@
#include "standing.h"
#include <assert.h>
#include <time.h>
Node
::
Node
(
Standing
*
_standing
,
AiImpl
*
ai
)
:
standing
(
_standing
),
...
...
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