Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hagraah Pendu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sofiane Lasri
Hagraah Pendu
Commits
33497bb6
Commit
33497bb6
authored
2 years ago
by
ychaili
Browse files
Options
Downloads
Patches
Plain Diff
guessLetter()
parent
1838eaac
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Pendu/GameEngine.swift
+11
-7
11 additions, 7 deletions
Pendu/GameEngine.swift
PenduTests/PenduTests.swift
+1
-1
1 addition, 1 deletion
PenduTests/PenduTests.swift
with
12 additions
and
8 deletions
Pendu/GameEngine.swift
+
11
−
7
View file @
33497bb6
...
...
@@ -23,7 +23,6 @@ class GameEngine: NSObject {
private
var
wordToGuess
:
String
=
""
private
var
attemptsRemaining
:
Int
=
0
private
var
guessedLetters
:
[
Character
]
=
[]
override
init
()
{
//
...
...
@@ -75,13 +74,18 @@ class GameEngine: NSObject {
return
word
}
public
func
startNewGame
(
difficulty
:
String
)
->
Void
{
print
(
WordToGuess
(
theme
:
"Animals"
,
difficulty
:
"Easy"
))
//public func startNewGame(difficulty: String) -> Void {
//wordToGuess = WordToGuess(theme: "Animals", difficulty: "Easy")
//}
public
func
guessLetter
(
letter
:
Character
)
->
Bool
{
if
wordToGuess
.
contains
(
letter
)
{
return
true
}
else
{
return
false
}
public
func
guessLetter
(
letter
:
Character
)
->
Void
{
// Vérification de la lettre proposée par le joueur
// Mise à jour de l'état de la lettre
}
public
func
isGameOver
()
->
Bool
{
...
...
This diff is collapsed.
Click to expand it.
PenduTests/PenduTests.swift
+
1
−
1
View file @
33497bb6
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