summaryrefslogtreecommitdiff
path: root/Games/Snake
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-10-15 12:26:33 +0200
committerAndreas Kling <kling@serenityos.org>2020-10-17 23:20:31 +0200
commit80e23d1b9854aa1d9cf94b4ba9459dd8befccf84 (patch)
tree9a0e84adaf4d7a467e8e4ffda9014162366cde11 /Games/Snake
parent56cf272ed5425206614a62d83584b0dc4d2bfd10 (diff)
downloadserenity-80e23d1b9854aa1d9cf94b4ba9459dd8befccf84.zip
Games: Use new format functions.
Diffstat (limited to 'Games/Snake')
-rw-r--r--Games/Snake/SnakeGame.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp
index 3d2bf109e1..32c7f45faf 100644
--- a/Games/Snake/SnakeGame.cpp
+++ b/Games/Snake/SnakeGame.cpp
@@ -45,7 +45,7 @@ SnakeGame::SnakeGame()
auto config = Core::ConfigFile::get_for_app("Snake");
m_high_score = config->read_num_entry("Snake", "HighScore", 0);
- m_high_score_text = String::format("Best: %u", m_high_score);
+ m_high_score_text = String::formatted("Best: {}", m_high_score);
}
SnakeGame::~SnakeGame()
@@ -146,10 +146,10 @@ void SnakeGame::timer_event(Core::TimerEvent&)
if (m_head == m_fruit) {
++m_length;
++m_score;
- m_score_text = String::format("Score: %u", m_score);
+ m_score_text = String::formatted("Score: {}", m_score);
if (m_score > m_high_score) {
m_high_score = m_score;
- m_high_score_text = String::format("Best: %u", m_high_score);
+ m_high_score_text = String::formatted("Best: {}", m_high_score);
update(high_score_rect());
auto config = Core::ConfigFile::get_for_app("Snake");
config->write_num_entry("Snake", "HighScore", m_high_score);