Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Assignment 2048
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
h45-taylor
Assignment 2048
Commits
3317d89c
Commit
3317d89c
authored
1 year ago
by
h45-taylor
Browse files
Options
Downloads
Patches
Plain Diff
created new application that shows probability of the random number in my program
parent
c68a3907
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
README.md
+2
-4
2 additions, 4 deletions
README.md
rnd.cpp
+40
-0
40 additions, 0 deletions
rnd.cpp
with
44 additions
and
5 deletions
.gitignore
+
2
−
1
View file @
3317d89c
build/
.vscode
a.out
rnd
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
+
2
−
4
View file @
3317d89c
...
...
@@ -18,11 +18,9 @@
*
You can use w/a/s/d or W/A/S/D to control the game.
*
If there is no empty cells left with no valid moves then the game will end..
## The Aim
The aim of the game is to get one of the tiles upto a score of 2048 by combining other tiles.
*
If there is no empty cells left with no valid moves then the game will end.
*
If you get one of the cells to 2048 you win.
## The functions in depth
...
...
This diff is collapsed.
Click to expand it.
rnd.cpp
0 → 100644
+
40
−
0
View file @
3317d89c
#include
<iostream>
#include
<ctime>
using
namespace
std
;
int
main
()
{
int
avg2
=
0
;
int
avg4
=
0
;
int
Loop
;
srand
(
time
(
0
));
for
(
Loop
=
0
;
Loop
<
100
;
Loop
++
)
{
int
random
=
rand
();
cout
<<
random
<<
endl
;
int
randomaftr
=
rand
()
%
2
;
cout
<<
randomaftr
<<
endl
;
int
randpone
=
randomaftr
+
1
;
cout
<<
randpone
<<
endl
;
int
randmtwo
=
randpone
*
2
;
cout
<<
randmtwo
<<
endl
;
if
(
randmtwo
==
2
)
{
avg2
++
;
}
if
(
randmtwo
==
4
)
{
avg4
++
;
}
}
cout
<<
"After "
<<
Loop
<<
" loops, We have resulted in 2 a total of "
<<
avg2
<<
" times and 4 "
<<
avg4
<<
" times."
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment