adding hw 6 start
This commit is contained in:
4
.idea/misc.xml
generated
Normal file
4
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
94
Hw6/CMakeLists.txt
Normal file
94
Hw6/CMakeLists.txt
Normal file
@@ -0,0 +1,94 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(Hw5)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
#
|
||||
# Manually specifying all the source files.
|
||||
#
|
||||
set(HEADER_FILES
|
||||
WordTree.hpp
|
||||
rlutil.h)
|
||||
set(SOURCE_FILES
|
||||
WordTree.cpp )
|
||||
set(UNIT_TEST_FILES
|
||||
TestWordTree.cpp)
|
||||
|
||||
add_executable(TypeAhead ${HEADER_FILES} ${SOURCE_FILES} main.cpp )
|
||||
add_executable(UnitTestRunner ${HEADER_FILES} ${SOURCE_FILES} ${UNIT_TEST_FILES})
|
||||
|
||||
#
|
||||
# We want the C++ 17 standard for our project
|
||||
#
|
||||
set_property(TARGET TypeAhead PROPERTY CXX_STANDARD 17)
|
||||
set_property(TARGET UnitTestRunner PROPERTY CXX_STANDARD 17)
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
target_compile_options(TypeAhead PRIVATE /W4 /permissive-)
|
||||
target_compile_options(UnitTestRunner PRIVATE /W4 /permissive-)
|
||||
set_target_properties(UnitTestRunner PROPERTIES LINK_FLAGS "/STACK:10000000")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
target_compile_options(TypeAhead PRIVATE -Wall -Wextra -pedantic -Wl,--stack,10000000 -O3)
|
||||
target_compile_options(UnitTestRunner PRIVATE -Wall -Wextra -pedantic -Wl,--stack,10000000 -O3)
|
||||
endif()
|
||||
#
|
||||
# Prepare a pre-build step to run clang-format over all the [ch]pp source files.
|
||||
# Start by finding the location of the clang-format executable.
|
||||
#
|
||||
find_program(CLANG_FORMAT "clang-format")
|
||||
if (CLANG_FORMAT)
|
||||
#
|
||||
# Need to take the simple source file locations used for the project and get their full
|
||||
# file system locations for use in putting together the clang-format command line
|
||||
#
|
||||
unset(SOURCE_FILES_PATHS)
|
||||
foreach(SOURCE_FILE ${HEADER_FILES} ${SOURCE_FILES} ${UNIT_TEST_FILES} main.cpp)
|
||||
get_source_file_property(WHERE ${SOURCE_FILE} LOCATION)
|
||||
set(SOURCE_FILES_PATHS ${SOURCE_FILES_PATHS} ${WHERE})
|
||||
endforeach()
|
||||
|
||||
|
||||
#
|
||||
# This creates the clang-format target/command
|
||||
#
|
||||
add_custom_target(
|
||||
ClangFormat
|
||||
COMMAND ${CLANG_FORMAT}
|
||||
-i
|
||||
-style=file
|
||||
${SOURCE_FILES_PATHS}
|
||||
)
|
||||
#
|
||||
# This makes the clang-format target a dependency of the main GoogleTestIntro project
|
||||
#
|
||||
add_dependencies(TypeAhead ClangFormat)
|
||||
else()
|
||||
message("Unable to find clang-format")
|
||||
endif()
|
||||
|
||||
configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
|
||||
RESULT_VARIABLE result
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
|
||||
if(result)
|
||||
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
|
||||
endif()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --build .
|
||||
RESULT_VARIABLE result
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
|
||||
if(result)
|
||||
message(FATAL_ERROR "Build step for googletest failed: ${result}")
|
||||
endif()
|
||||
|
||||
# Prevent overriding the parent project's compiler/linker
|
||||
# settings on Windows
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
# Add googletest directly to our build. This defines
|
||||
# the gtest and gtest_main targets.
|
||||
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
|
||||
${CMAKE_CURRENT_BINARY_DIR}/googletest-build
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
# Now simply link against gtest or gtest_main as needed. Eg
|
||||
target_link_libraries(UnitTestRunner gtest_main)
|
||||
15
Hw6/CMakeLists.txt.in
Executable file
15
Hw6/CMakeLists.txt.in
Executable file
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(googletest-download NONE)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG master
|
||||
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
|
||||
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
4
Hw6/LifeSimulator.cpp
Normal file
4
Hw6/LifeSimulator.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
8
Hw6/LifeSimulator.hpp
Normal file
8
Hw6/LifeSimulator.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_LIFESIMULATOR_HPP
|
||||
#define CS3460_CPP_LIFESIMULATOR_HPP
|
||||
|
||||
#endif //CS3460_CPP_LIFESIMULATOR_HPP
|
||||
8
Hw6/Pattern.hpp
Normal file
8
Hw6/Pattern.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_PATTERN_HPP
|
||||
#define CS3460_CPP_PATTERN_HPP
|
||||
|
||||
#endif //CS3460_CPP_PATTERN_HPP
|
||||
5
Hw6/PatternAcorn.cpp
Normal file
5
Hw6/PatternAcorn.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#include "PatternAcorn.hpp"
|
||||
8
Hw6/PatternAcorn.hpp
Normal file
8
Hw6/PatternAcorn.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_PATTERNACORN_HPP
|
||||
#define CS3460_CPP_PATTERNACORN_HPP
|
||||
|
||||
#endif //CS3460_CPP_PATTERNACORN_HPP
|
||||
5
Hw6/PatternBlinker.cpp
Normal file
5
Hw6/PatternBlinker.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#include "PatternBlinker.hpp"
|
||||
8
Hw6/PatternBlinker.hpp
Normal file
8
Hw6/PatternBlinker.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_PATTERNBLINKER_HPP
|
||||
#define CS3460_CPP_PATTERNBLINKER_HPP
|
||||
|
||||
#endif //CS3460_CPP_PATTERNBLINKER_HPP
|
||||
5
Hw6/PatternBlock.cpp
Normal file
5
Hw6/PatternBlock.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#include "PatternBlock.hpp"
|
||||
8
Hw6/PatternBlock.hpp
Normal file
8
Hw6/PatternBlock.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_PATTERNBLOCK_HPP
|
||||
#define CS3460_CPP_PATTERNBLOCK_HPP
|
||||
|
||||
#endif //CS3460_CPP_PATTERNBLOCK_HPP
|
||||
5
Hw6/PatternGlider.cpp
Normal file
5
Hw6/PatternGlider.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#include "PatternGlider.hpp"
|
||||
8
Hw6/PatternGlider.hpp
Normal file
8
Hw6/PatternGlider.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_PATTERNGLIDER_HPP
|
||||
#define CS3460_CPP_PATTERNGLIDER_HPP
|
||||
|
||||
#endif //CS3460_CPP_PATTERNGLIDER_HPP
|
||||
5
Hw6/PatternGosperGliderGun.cpp
Normal file
5
Hw6/PatternGosperGliderGun.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#include "PatternGosperGliderGun.hpp"
|
||||
8
Hw6/PatternGosperGliderGun.hpp
Normal file
8
Hw6/PatternGosperGliderGun.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_PATTERNGOSPERGLIDERGUN_HPP
|
||||
#define CS3460_CPP_PATTERNGOSPERGLIDERGUN_HPP
|
||||
|
||||
#endif //CS3460_CPP_PATTERNGOSPERGLIDERGUN_HPP
|
||||
5
Hw6/RendererConsole.cpp
Normal file
5
Hw6/RendererConsole.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#include "RendererConsole.hpp"
|
||||
8
Hw6/RendererConsole.hpp
Normal file
8
Hw6/RendererConsole.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
#ifndef CS3460_CPP_RENDERERCONSOLE_HPP
|
||||
#define CS3460_CPP_RENDERERCONSOLE_HPP
|
||||
|
||||
#endif //CS3460_CPP_RENDERERCONSOLE_HPP
|
||||
13
Hw6/_clang-format
Normal file
13
Hw6/_clang-format
Normal file
@@ -0,0 +1,13 @@
|
||||
Language: Cpp
|
||||
ColumnLimit: 0
|
||||
BreakBeforeBraces : Allman
|
||||
BreakConstructorInitializers: AfterColon
|
||||
Cpp11BracedListStyle: true
|
||||
IndentCaseLabels: true
|
||||
NamespaceIndentation: All
|
||||
IndentWidth: 4
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
DerivePointerAlignment: false
|
||||
PointerAlignment: Left
|
||||
IncludeBlocks: Regroup
|
||||
4
Hw6/main.cpp
Normal file
4
Hw6/main.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
//
|
||||
// Created by Brady Bodily on 11/5/19.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user