saving current work.

This commit is contained in:
Daniel Jones 2023-09-19 14:11:06 -05:00
parent f7597a8e75
commit fe486d770b
2 changed files with 8 additions and 15 deletions

View File

@ -6,7 +6,7 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)

View File

@ -8,15 +8,13 @@
#include "mainwindow.h"
#include "./ui_mainwindow.h"
#include <chrono>
#include <iostream>
#include <random>
QString verse_display();
std::string verse_grab(int day);
std::string verse_grab();
MainWindow::MainWindow(QWidget *parent)
@ -33,19 +31,14 @@ MainWindow::~MainWindow()
delete ui;
}
//As name implies, randomly chooses a number between 1 and 100.
int random_verse(){
std::random_device rd;
std:: uniform_int_distribution<int> dist(1, 100);
return dist(rd);
}
//This is the function that will load the verse into the program.
QString verse_display()
{
std::string verse_text;
int verse_day = random_verse();
verse_text = verse_grab(verse_day);
verse_text = verse_grab();
QString returned_string = QString::fromStdString(verse_text);
@ -53,10 +46,10 @@ QString verse_display()
}
std::string verse_grab(int day){
std::string verse_grab(){
std::string my_verse;
my_verse = "Hello, this is a verse!";
return my_verse;
}