diff --git a/.github/workflows/java-autoformat.yml b/.github/workflows/java-autoformat.yml index 7aa2487cb..116332804 100644 --- a/.github/workflows/java-autoformat.yml +++ b/.github/workflows/java-autoformat.yml @@ -2,8 +2,10 @@ name: Java Code Auto Format on: pull_request jobs: - format: - if: github.event.pull_request.head.repo.full_name == github.repository + format_dev: + if: | + github.event.pull_request.head.ref == 'dev' && + github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: - name: Checkout code @@ -15,7 +17,6 @@ jobs: uses: actions/setup-java@v1 with: java-version: 21 - distribution: temurin - name: Grant execute permission for gradlew run: chmod +x gradlew @@ -28,7 +29,58 @@ jobs: - name: Check for modified files id: git-check - run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT + run: echo "modified=$(if [[ -n $(git status -s) ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT + + - name: Create temporary branch and pull request + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name 'Bram van Heuveln' + git config --global user.email 'bram28@users.noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + branch_name="auto-format-code-$(date +%s)" + git checkout -b $branch_name + ./gradlew :spotlessApply + git add . + git commit -am "Automated Java code formatting changes" + git push --set-upstream origin $branch_name + gh pr create -B dev -H $branch_name --title 'Automated Java code formatting changes' --body 'This pull request contains automated code formatting changes.' --reviewer ${{ github.actor }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Must approve auto-format pull request + if: steps.git-check.outputs.modified == 'true' + run: | + echo "Please review and approve the appropriate auto-format-code pull request." + exit 1 + + format_pull_request_to_dev: + if: | + github.event.pull_request.base.ref == 'dev' && + github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v1 + with: + ref: ${{ github.head_ref }} + + - name: Set up JDK 21 + uses: actions/setup-java@v1 + with: + java-version: 21 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build -x test + + - name: Run spotless + run: ./gradlew :spotlessApply + + - name: Check for modified files + id: git-check + run: echo "modified=$(if [[ -n $(git status -s) ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT - name: Push changes if: steps.git-check.outputs.modified == 'true' @@ -37,4 +89,5 @@ jobs: git config --global user.email 'bram28@users.noreply.github.com' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git add . - git diff --cached --exit-code || git commit -am "Automated Java code formatting changes" && git push \ No newline at end of file + git commit -am "Automated Java code formatting changes" + git push diff --git a/.github/workflows/publish-javadoc.yml b/.github/workflows/publish-javadoc.yml index 4e1e64608..8818f74b5 100644 --- a/.github/workflows/publish-javadoc.yml +++ b/.github/workflows/publish-javadoc.yml @@ -18,6 +18,7 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} javadoc-branch: javadoc - java-version: 11 + java-version: 21 + distribution: temurin target-folder: docs project: gradle \ No newline at end of file diff --git a/build.gradle b/build.gradle index 319cefa4f..38a94e3f3 100644 --- a/build.gradle +++ b/build.gradle @@ -104,40 +104,6 @@ jar { archiveFileName = 'Legup.jar' } -/* - * CREATES NATIVE WINDOWS EXECUTABLE - * Launches launch4j to create an executable (.exe) file wrapping the jar - * THIS IS NOT THE INSTALLER - * Add "icon = 'path/to/icon.ico'" to set an icon for the executable - */ -createExe() { - mainClassName = 'edu.rpi.legup.Legup' - outputDir = '../native/windows' - outfile = 'bin/Legup.exe' - bundledJrePath = 'jre' - bundledJre64Bit = true - jdkPreference = 'preferJre' - jreMinVersion = '21' - jreRuntimeBits = '64/32' -} - -/* - * CREATES NATIVE WINDOWS INSTALLER -- ONLY RUNS ON WINDOWS - * Runs the shipped version of Inno Setup (6.2) to compile the installer - * Modify the setup settings in native/windows/legup_inno_setup.iss - * - * Modifications are likely required to run the setup script on your computer: - * Edit the "CHANGE ME" line in native/windows/legup_inno_setup.iss to reflect - * the path to the Java installation you want to ship inside the executable. - */ -task buildNativeWindows(type: Exec, dependsOn: 'createExe') { - jar - createExe - - workingDir = "${buildDir}/../native/windows" - commandLine 'cmd', '/c', 'make_windows_installer.bat' -} - repositories { mavenCentral() } diff --git a/native/linux/.keep b/native/linux/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/native/macos/.keep b/native/macos/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/native/windows/OLD_inno_setup.iss b/native/windows/OLD_inno_setup.iss deleted file mode 100644 index 528b0b660..000000000 --- a/native/windows/OLD_inno_setup.iss +++ /dev/null @@ -1,53 +0,0 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -#define MyAppName "Legup" -#define MyAppVersion "2.0" -#define MyAppPublisher "Bram, Inc." -#define MyAppURL "https://github.com/jpoegs/legup2.0" -#define MyAppExeName "Legup.jar" - -[Setup] -; NOTE: The value of AppId uniquely identifies this application. -; Do not use the same AppId value in installers for other applications. -; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{C1DFC564-DE07-4A5D-BF85-DDCF514B57BA} -AppName={#MyAppName} -AppVersion={#MyAppVersion} -;AppVerName={#MyAppName} {#MyAppVersion} -AppPublisher={#MyAppPublisher} -AppPublisherURL={#MyAppURL} -AppSupportURL={#MyAppURL} -AppUpdatesURL={#MyAppURL} -DefaultDirName={pf}\{#MyAppName} -DisableProgramGroupPage=yes -OutputBaseFilename=setup -Compression=lzma -SolidCompression=yes -ChangesAssociations=yes - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked -Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 - -[Files] -Source: "D:\GitHub\Legup\build\libs\Legup.jar"; DestDir: "{app}"; Flags: ignoreversion -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon -Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon - -[Run] -Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent - -[Registry] - -Root: HKCR; Subkey: ".legup"; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue; ValueType: string; ValueName: "" -Root: HKCR; Subkey: "{#MyAppName}"; ValueData: "{#MyAppName}"; Flags: uninsdeletekey; ValueType: string; ValueName: "" -Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\{#MyAppExeName},0"; ValueType: string; ValueName: "" -Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: "" \ No newline at end of file diff --git a/native/windows/inno-setup/Compil32.exe b/native/windows/inno-setup/Compil32.exe deleted file mode 100644 index 544993108..000000000 Binary files a/native/windows/inno-setup/Compil32.exe and /dev/null differ diff --git a/native/windows/inno-setup/Default.isl b/native/windows/inno-setup/Default.isl deleted file mode 100644 index ce9b70e2e..000000000 --- a/native/windows/inno-setup/Default.isl +++ /dev/null @@ -1,384 +0,0 @@ -; *** Inno Setup version 6.1.0+ English messages *** -; -; To download user-contributed translations of this file, go to: -; https://jrsoftware.org/files/istrans/ -; -; Note: When translating this text, do not add periods (.) to the end of -; messages that didn't have them already, because on those messages Inno -; Setup adds the periods automatically (appending a period would result in -; two periods being displayed). - -[LangOptions] -; The following three entries are very important. Be sure to read and -; understand the '[LangOptions] section' topic in the help file. -LanguageName=English -LanguageID=$0409 -LanguageCodePage=0 -; If the language you are translating to requires special font faces or -; sizes, uncomment any of the following entries and change them accordingly. -;DialogFontName= -;DialogFontSize=8 -;WelcomeFontName=Verdana -;WelcomeFontSize=12 -;TitleFontName=Arial -;TitleFontSize=29 -;CopyrightFontName=Arial -;CopyrightFontSize=8 - -[Messages] - -; *** Application titles -SetupAppTitle=Setup -SetupWindowTitle=Setup - %1 -UninstallAppTitle=Uninstall -UninstallAppFullTitle=%1 Uninstall - -; *** Misc. common -InformationTitle=Information -ConfirmTitle=Confirm -ErrorTitle=Error - -; *** SetupLdr messages -SetupLdrStartupMessage=This will install %1. Do you wish to continue? -LdrCannotCreateTemp=Unable to create a temporary file. Setup aborted -LdrCannotExecTemp=Unable to execute file in the temporary directory. Setup aborted -HelpTextNote= - -; *** Startup error messages -LastErrorMessage=%1.%n%nError %2: %3 -SetupFileMissing=The file %1 is missing from the installation directory. Please correct the problem or obtain a new copy of the program. -SetupFileCorrupt=The setup files are corrupted. Please obtain a new copy of the program. -SetupFileCorruptOrWrongVer=The setup files are corrupted, or are incompatible with this version of Setup. Please correct the problem or obtain a new copy of the program. -InvalidParameter=An invalid parameter was passed on the command line:%n%n%1 -SetupAlreadyRunning=Setup is already running. -WindowsVersionNotSupported=This program does not support the version of Windows your computer is running. -WindowsServicePackRequired=This program requires %1 Service Pack %2 or later. -NotOnThisPlatform=This program will not run on %1. -OnlyOnThisPlatform=This program must be run on %1. -OnlyOnTheseArchitectures=This program can only be installed on versions of Windows designed for the following processor architectures:%n%n%1 -WinVersionTooLowError=This program requires %1 version %2 or later. -WinVersionTooHighError=This program cannot be installed on %1 version %2 or later. -AdminPrivilegesRequired=You must be logged in as an administrator when installing this program. -PowerUserPrivilegesRequired=You must be logged in as an administrator or as a member of the Power Users group when installing this program. -SetupAppRunningError=Setup has detected that %1 is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit. -UninstallAppRunningError=Uninstall has detected that %1 is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit. - -; *** Startup questions -PrivilegesRequiredOverrideTitle=Select Setup Install Mode -PrivilegesRequiredOverrideInstruction=Select install mode -PrivilegesRequiredOverrideText1=%1 can be installed for all users (requires administrative privileges), or for you only. -PrivilegesRequiredOverrideText2=%1 can be installed for you only, or for all users (requires administrative privileges). -PrivilegesRequiredOverrideAllUsers=Install for &all users -PrivilegesRequiredOverrideAllUsersRecommended=Install for &all users (recommended) -PrivilegesRequiredOverrideCurrentUser=Install for &me only -PrivilegesRequiredOverrideCurrentUserRecommended=Install for &me only (recommended) - -; *** Misc. errors -ErrorCreatingDir=Setup was unable to create the directory "%1" -ErrorTooManyFilesInDir=Unable to create a file in the directory "%1" because it contains too many files - -; *** Setup common messages -ExitSetupTitle=Exit Setup -ExitSetupMessage=Setup is not complete. If you exit now, the program will not be installed.%n%nYou may run Setup again at another time to complete the installation.%n%nExit Setup? -AboutSetupMenuItem=&About Setup... -AboutSetupTitle=About Setup -AboutSetupMessage=%1 version %2%n%3%n%n%1 home page:%n%4 -AboutSetupNote= -TranslatorNote= - -; *** Buttons -ButtonBack=< &Back -ButtonNext=&Next > -ButtonInstall=&Install -ButtonOK=OK -ButtonCancel=Cancel -ButtonYes=&Yes -ButtonYesToAll=Yes to &All -ButtonNo=&No -ButtonNoToAll=N&o to All -ButtonFinish=&Finish -ButtonBrowse=&Browse... -ButtonWizardBrowse=B&rowse... -ButtonNewFolder=&Make New Folder - -; *** "Select Language" dialog messages -SelectLanguageTitle=Select Setup Language -SelectLanguageLabel=Select the language to use during the installation. - -; *** Common wizard text -ClickNext=Click Next to continue, or Cancel to exit Setup. -BeveledLabel= -BrowseDialogTitle=Browse For Folder -BrowseDialogLabel=Select a folder in the list below, then click OK. -NewFolderName=New Folder - -; *** "Welcome" wizard page -WelcomeLabel1=Welcome to the [name] Setup Wizard -WelcomeLabel2=This will install [name/ver] on your computer.%n%nIt is recommended that you close all other applications before continuing. - -; *** "Password" wizard page -WizardPassword=Password -PasswordLabel1=This installation is password protected. -PasswordLabel3=Please provide the password, then click Next to continue. Passwords are case-sensitive. -PasswordEditLabel=&Password: -IncorrectPassword=The password you entered is not correct. Please try again. - -; *** "License Agreement" wizard page -WizardLicense=License Agreement -LicenseLabel=Please read the following important information before continuing. -LicenseLabel3=Please read the following License Agreement. You must accept the terms of this agreement before continuing with the installation. -LicenseAccepted=I &accept the agreement -LicenseNotAccepted=I &do not accept the agreement - -; *** "Information" wizard pages -WizardInfoBefore=Information -InfoBeforeLabel=Please read the following important information before continuing. -InfoBeforeClickLabel=When you are ready to continue with Setup, click Next. -WizardInfoAfter=Information -InfoAfterLabel=Please read the following important information before continuing. -InfoAfterClickLabel=When you are ready to continue with Setup, click Next. - -; *** "User Information" wizard page -WizardUserInfo=User Information -UserInfoDesc=Please enter your information. -UserInfoName=&User Name: -UserInfoOrg=&Organization: -UserInfoSerial=&Serial Number: -UserInfoNameRequired=You must enter a name. - -; *** "Select Destination Location" wizard page -WizardSelectDir=Select Destination Location -SelectDirDesc=Where should [name] be installed? -SelectDirLabel3=Setup will install [name] into the following folder. -SelectDirBrowseLabel=To continue, click Next. If you would like to select a different folder, click Browse. -DiskSpaceGBLabel=At least [gb] GB of free disk space is required. -DiskSpaceMBLabel=At least [mb] MB of free disk space is required. -CannotInstallToNetworkDrive=Setup cannot install to a network drive. -CannotInstallToUNCPath=Setup cannot install to a UNC path. -InvalidPath=You must enter a full path with drive letter; for example:%n%nC:\APP%n%nor a UNC path in the form:%n%n\\server\share -InvalidDrive=The drive or UNC share you selected does not exist or is not accessible. Please select another. -DiskSpaceWarningTitle=Not Enough Disk Space -DiskSpaceWarning=Setup requires at least %1 KB of free space to install, but the selected drive only has %2 KB available.%n%nDo you want to continue anyway? -DirNameTooLong=The folder name or path is too long. -InvalidDirName=The folder name is not valid. -BadDirName32=Folder names cannot include any of the following characters:%n%n%1 -DirExistsTitle=Folder Exists -DirExists=The folder:%n%n%1%n%nalready exists. Would you like to install to that folder anyway? -DirDoesntExistTitle=Folder Does Not Exist -DirDoesntExist=The folder:%n%n%1%n%ndoes not exist. Would you like the folder to be created? - -; *** "Select Components" wizard page -WizardSelectComponents=Select Components -SelectComponentsDesc=Which components should be installed? -SelectComponentsLabel2=Select the components you want to install; clear the components you do not want to install. Click Next when you are ready to continue. -FullInstallation=Full installation -; if possible don't translate 'Compact' as 'Minimal' (I mean 'Minimal' in your language) -CompactInstallation=Compact installation -CustomInstallation=Custom installation -NoUninstallWarningTitle=Components Exist -NoUninstallWarning=Setup has detected that the following components are already installed on your computer:%n%n%1%n%nDeselecting these components will not uninstall them.%n%nWould you like to continue anyway? -ComponentSize1=%1 KB -ComponentSize2=%1 MB -ComponentsDiskSpaceGBLabel=Current selection requires at least [gb] GB of disk space. -ComponentsDiskSpaceMBLabel=Current selection requires at least [mb] MB of disk space. - -; *** "Select Additional Tasks" wizard page -WizardSelectTasks=Select Additional Tasks -SelectTasksDesc=Which additional tasks should be performed? -SelectTasksLabel2=Select the additional tasks you would like Setup to perform while installing [name], then click Next. - -; *** "Select Start Menu Folder" wizard page -WizardSelectProgramGroup=Select Start Menu Folder -SelectStartMenuFolderDesc=Where should Setup place the program's shortcuts? -SelectStartMenuFolderLabel3=Setup will create the program's shortcuts in the following Start Menu folder. -SelectStartMenuFolderBrowseLabel=To continue, click Next. If you would like to select a different folder, click Browse. -MustEnterGroupName=You must enter a folder name. -GroupNameTooLong=The folder name or path is too long. -InvalidGroupName=The folder name is not valid. -BadGroupName=The folder name cannot include any of the following characters:%n%n%1 -NoProgramGroupCheck2=&Don't create a Start Menu folder - -; *** "Ready to Install" wizard page -WizardReady=Ready to Install -ReadyLabel1=Setup is now ready to begin installing [name] on your computer. -ReadyLabel2a=Click Install to continue with the installation, or click Back if you want to review or change any settings. -ReadyLabel2b=Click Install to continue with the installation. -ReadyMemoUserInfo=User information: -ReadyMemoDir=Destination location: -ReadyMemoType=Setup type: -ReadyMemoComponents=Selected components: -ReadyMemoGroup=Start Menu folder: -ReadyMemoTasks=Additional tasks: - -; *** TDownloadWizardPage wizard page and DownloadTemporaryFile -DownloadingLabel=Downloading additional files... -ButtonStopDownload=&Stop download -StopDownload=Are you sure you want to stop the download? -ErrorDownloadAborted=Download aborted -ErrorDownloadFailed=Download failed: %1 %2 -ErrorDownloadSizeFailed=Getting size failed: %1 %2 -ErrorFileHash1=File hash failed: %1 -ErrorFileHash2=Invalid file hash: expected %1, found %2 -ErrorProgress=Invalid progress: %1 of %2 -ErrorFileSize=Invalid file size: expected %1, found %2 - -; *** "Preparing to Install" wizard page -WizardPreparing=Preparing to Install -PreparingDesc=Setup is preparing to install [name] on your computer. -PreviousInstallNotCompleted=The installation/removal of a previous program was not completed. You will need to restart your computer to complete that installation.%n%nAfter restarting your computer, run Setup again to complete the installation of [name]. -CannotContinue=Setup cannot continue. Please click Cancel to exit. -ApplicationsFound=The following applications are using files that need to be updated by Setup. It is recommended that you allow Setup to automatically close these applications. -ApplicationsFound2=The following applications are using files that need to be updated by Setup. It is recommended that you allow Setup to automatically close these applications. After the installation has completed, Setup will attempt to restart the applications. -CloseApplications=&Automatically close the applications -DontCloseApplications=&Do not close the applications -ErrorCloseApplications=Setup was unable to automatically close all applications. It is recommended that you close all applications using files that need to be updated by Setup before continuing. -PrepareToInstallNeedsRestart=Setup must restart your computer. After restarting your computer, run Setup again to complete the installation of [name].%n%nWould you like to restart now? - -; *** "Installing" wizard page -WizardInstalling=Installing -InstallingLabel=Please wait while Setup installs [name] on your computer. - -; *** "Setup Completed" wizard page -FinishedHeadingLabel=Completing the [name] Setup Wizard -FinishedLabelNoIcons=Setup has finished installing [name] on your computer. -FinishedLabel=Setup has finished installing [name] on your computer. The application may be launched by selecting the installed shortcuts. -ClickFinish=Click Finish to exit Setup. -FinishedRestartLabel=To complete the installation of [name], Setup must restart your computer. Would you like to restart now? -FinishedRestartMessage=To complete the installation of [name], Setup must restart your computer.%n%nWould you like to restart now? -ShowReadmeCheck=Yes, I would like to view the README file -YesRadio=&Yes, restart the computer now -NoRadio=&No, I will restart the computer later -; used for example as 'Run MyProg.exe' -RunEntryExec=Run %1 -; used for example as 'View Readme.txt' -RunEntryShellExec=View %1 - -; *** "Setup Needs the Next Disk" stuff -ChangeDiskTitle=Setup Needs the Next Disk -SelectDiskLabel2=Please insert Disk %1 and click OK.%n%nIf the files on this disk can be found in a folder other than the one displayed below, enter the correct path or click Browse. -PathLabel=&Path: -FileNotInDir2=The file "%1" could not be located in "%2". Please insert the correct disk or select another folder. -SelectDirectoryLabel=Please specify the location of the next disk. - -; *** Installation phase messages -SetupAborted=Setup was not completed.%n%nPlease correct the problem and run Setup again. -AbortRetryIgnoreSelectAction=Select action -AbortRetryIgnoreRetry=&Try again -AbortRetryIgnoreIgnore=&Ignore the error and continue -AbortRetryIgnoreCancel=Cancel installation - -; *** Installation status messages -StatusClosingApplications=Closing applications... -StatusCreateDirs=Creating directories... -StatusExtractFiles=Extracting files... -StatusCreateIcons=Creating shortcuts... -StatusCreateIniEntries=Creating INI entries... -StatusCreateRegistryEntries=Creating registry entries... -StatusRegisterFiles=Registering files... -StatusSavingUninstall=Saving uninstall information... -StatusRunProgram=Finishing installation... -StatusRestartingApplications=Restarting applications... -StatusRollback=Rolling back changes... - -; *** Misc. errors -ErrorInternal2=Internal error: %1 -ErrorFunctionFailedNoCode=%1 failed -ErrorFunctionFailed=%1 failed; code %2 -ErrorFunctionFailedWithMessage=%1 failed; code %2.%n%3 -ErrorExecutingProgram=Unable to execute file:%n%1 - -; *** Registry errors -ErrorRegOpenKey=Error opening registry key:%n%1\%2 -ErrorRegCreateKey=Error creating registry key:%n%1\%2 -ErrorRegWriteKey=Error writing to registry key:%n%1\%2 - -; *** INI errors -ErrorIniEntry=Error creating INI entry in file "%1". - -; *** File copying errors -FileAbortRetryIgnoreSkipNotRecommended=&Skip this file (not recommended) -FileAbortRetryIgnoreIgnoreNotRecommended=&Ignore the error and continue (not recommended) -SourceIsCorrupted=The source file is corrupted -SourceDoesntExist=The source file "%1" does not exist -ExistingFileReadOnly2=The existing file could not be replaced because it is marked read-only. -ExistingFileReadOnlyRetry=&Remove the read-only attribute and try again -ExistingFileReadOnlyKeepExisting=&Keep the existing file -ErrorReadingExistingDest=An error occurred while trying to read the existing file: -FileExistsSelectAction=Select action -FileExists2=The file already exists. -FileExistsOverwriteExisting=&Overwrite the existing file -FileExistsKeepExisting=&Keep the existing file -FileExistsOverwriteOrKeepAll=&Do this for the next conflicts -ExistingFileNewerSelectAction=Select action -ExistingFileNewer2=The existing file is newer than the one Setup is trying to install. -ExistingFileNewerOverwriteExisting=&Overwrite the existing file -ExistingFileNewerKeepExisting=&Keep the existing file (recommended) -ExistingFileNewerOverwriteOrKeepAll=&Do this for the next conflicts -ErrorChangingAttr=An error occurred while trying to change the attributes of the existing file: -ErrorCreatingTemp=An error occurred while trying to create a file in the destination directory: -ErrorReadingSource=An error occurred while trying to read the source file: -ErrorCopying=An error occurred while trying to copy a file: -ErrorReplacingExistingFile=An error occurred while trying to replace the existing file: -ErrorRestartReplace=RestartReplace failed: -ErrorRenamingTemp=An error occurred while trying to rename a file in the destination directory: -ErrorRegisterServer=Unable to register the DLL/OCX: %1 -ErrorRegSvr32Failed=RegSvr32 failed with exit code %1 -ErrorRegisterTypeLib=Unable to register the type library: %1 - -; *** Uninstall display name markings -; used for example as 'My Program (32-bit)' -UninstallDisplayNameMark=%1 (%2) -; used for example as 'My Program (32-bit, All users)' -UninstallDisplayNameMarks=%1 (%2, %3) -UninstallDisplayNameMark32Bit=32-bit -UninstallDisplayNameMark64Bit=64-bit -UninstallDisplayNameMarkAllUsers=All users -UninstallDisplayNameMarkCurrentUser=Current user - -; *** Post-installation errors -ErrorOpeningReadme=An error occurred while trying to open the README file. -ErrorRestartingComputer=Setup was unable to restart the computer. Please do this manually. - -; *** Uninstaller messages -UninstallNotFound=File "%1" does not exist. Cannot uninstall. -UninstallOpenError=File "%1" could not be opened. Cannot uninstall -UninstallUnsupportedVer=The uninstall log file "%1" is in a format not recognized by this version of the uninstaller. Cannot uninstall -UninstallUnknownEntry=An unknown entry (%1) was encountered in the uninstall log -ConfirmUninstall=Are you sure you want to completely remove %1 and all of its components? -UninstallOnlyOnWin64=This installation can only be uninstalled on 64-bit Windows. -OnlyAdminCanUninstall=This installation can only be uninstalled by a user with administrative privileges. -UninstallStatusLabel=Please wait while %1 is removed from your computer. -UninstalledAll=%1 was successfully removed from your computer. -UninstalledMost=%1 uninstall complete.%n%nSome elements could not be removed. These can be removed manually. -UninstalledAndNeedsRestart=To complete the uninstallation of %1, your computer must be restarted.%n%nWould you like to restart now? -UninstallDataCorrupted="%1" file is corrupted. Cannot uninstall - -; *** Uninstallation phase messages -ConfirmDeleteSharedFileTitle=Remove Shared File? -ConfirmDeleteSharedFile2=The system indicates that the following shared file is no longer in use by any programs. Would you like for Uninstall to remove this shared file?%n%nIf any programs are still using this file and it is removed, those programs may not function properly. If you are unsure, choose No. Leaving the file on your system will not cause any harm. -SharedFileNameLabel=File name: -SharedFileLocationLabel=Location: -WizardUninstalling=Uninstall Status -StatusUninstalling=Uninstalling %1... - -; *** Shutdown block reasons -ShutdownBlockReasonInstallingApp=Installing %1. -ShutdownBlockReasonUninstallingApp=Uninstalling %1. - -; The custom messages below aren't used by Setup itself, but if you make -; use of them in your scripts, you'll want to translate them. - -[CustomMessages] - -NameAndVersion=%1 version %2 -AdditionalIcons=Additional shortcuts: -CreateDesktopIcon=Create a &desktop shortcut -CreateQuickLaunchIcon=Create a &Quick Launch shortcut -ProgramOnTheWeb=%1 on the Web -UninstallProgram=Uninstall %1 -LaunchProgram=Launch %1 -AssocFileExtension=&Associate %1 with the %2 file extension -AssocingFileExtension=Associating %1 with the %2 file extension... -AutoStartProgramGroupDescription=Startup: -AutoStartProgram=Automatically start %1 -AddonHostProgramNotFound=%1 could not be located in the folder you selected.%n%nDo you want to continue anyway? diff --git a/native/windows/inno-setup/ISCC.exe b/native/windows/inno-setup/ISCC.exe deleted file mode 100644 index acca24fc5..000000000 Binary files a/native/windows/inno-setup/ISCC.exe and /dev/null differ diff --git a/native/windows/inno-setup/ISCmplr.dll b/native/windows/inno-setup/ISCmplr.dll deleted file mode 100644 index d44589666..000000000 Binary files a/native/windows/inno-setup/ISCmplr.dll and /dev/null differ diff --git a/native/windows/inno-setup/ISPP.chm b/native/windows/inno-setup/ISPP.chm deleted file mode 100644 index 1b211d649..000000000 Binary files a/native/windows/inno-setup/ISPP.chm and /dev/null differ diff --git a/native/windows/inno-setup/ISPP.dll b/native/windows/inno-setup/ISPP.dll deleted file mode 100644 index 4ce5cb657..000000000 Binary files a/native/windows/inno-setup/ISPP.dll and /dev/null differ diff --git a/native/windows/inno-setup/ISPPBuiltins.iss b/native/windows/inno-setup/ISPPBuiltins.iss deleted file mode 100644 index d42d7e97f..000000000 --- a/native/windows/inno-setup/ISPPBuiltins.iss +++ /dev/null @@ -1,323 +0,0 @@ -// Inno Setup Preprocessor -// -// Inno Setup (C) 1997-2021 Jordan Russell. All Rights Reserved. -// Portions Copyright (C) 2000-2021 Martijn Laan. All Rights Reserved. -// Portions Copyright (C) 2001-2004 Alex Yackimoff. All Rights Reserved. -// -// See the ISPP help file for more documentation of the functions defined by this file -// -#if defined(ISPP_INVOKED) && !defined(_BUILTINS_ISS_) -// -#if PREPROCVER < 0x01000000 -# error Inno Setup Preprocessor version is outdated -#endif -// -#define _BUILTINS_ISS_ -// -#ifdef __OPT_E__ -# define private EnableOptE -# pragma option -e- -#endif - -#ifndef __POPT_P__ -# define private DisablePOptP -#else -# pragma parseroption -p- -#endif - -#define NewLine "\n" -#define Tab "\t" - -#pragma parseroption -p+ - -#pragma spansymbol "\" - -#define True 1 -#define False 0 -#define Yes True -#define No False - -#define MaxInt 0x7FFFFFFFFFFFFFFFL -#define MinInt 0x8000000000000000L - -#define NULL -#define void - -// TypeOf constants - -#define TYPE_ERROR 0 -#define TYPE_NULL 1 -#define TYPE_INTEGER 2 -#define TYPE_STRING 3 -#define TYPE_MACRO 4 -#define TYPE_FUNC 5 -#define TYPE_ARRAY 6 - -// Helper macro to find out the type of an array element or expression. TypeOf -// standard function only allows identifier as its parameter. Use this macro -// to convert an expression to identifier. - -#define TypeOf2(any Expr) TypeOf(Expr) - -// ReadReg constants - -#define HKEY_CLASSES_ROOT 0x80000000UL -#define HKEY_CURRENT_USER 0x80000001UL -#define HKEY_LOCAL_MACHINE 0x80000002UL -#define HKEY_USERS 0x80000003UL -#define HKEY_CURRENT_CONFIG 0x80000005UL -#define HKEY_CLASSES_ROOT_64 0x82000000UL -#define HKEY_CURRENT_USER_64 0x82000001UL -#define HKEY_LOCAL_MACHINE_64 0x82000002UL -#define HKEY_USERS_64 0x82000003UL -#define HKEY_CURRENT_CONFIG_64 0x82000005UL - -#define HKCR HKEY_CLASSES_ROOT -#define HKCU HKEY_CURRENT_USER -#define HKLM HKEY_LOCAL_MACHINE -#define HKU HKEY_USERS -#define HKCC HKEY_CURRENT_CONFIG -#define HKCR64 HKEY_CLASSES_ROOT_64 -#define HKCU64 HKEY_CURRENT_USER_64 -#define HKLM64 HKEY_LOCAL_MACHINE_64 -#define HKU64 HKEY_USERS_64 -#define HKCC64 HKEY_CURRENT_CONFIG_64 - -// Exec constants - -#define SW_HIDE 0 -#define SW_SHOWNORMAL 1 -#define SW_NORMAL 1 -#define SW_SHOWMINIMIZED 2 -#define SW_SHOWMAXIMIZED 3 -#define SW_MAXIMIZE 3 -#define SW_SHOWNOACTIVATE 4 -#define SW_SHOW 5 -#define SW_MINIMIZE 6 -#define SW_SHOWMINNOACTIVE 7 -#define SW_SHOWNA 8 -#define SW_RESTORE 9 -#define SW_SHOWDEFAULT 10 -#define SW_MAX 10 - -// Find constants - -#define FIND_MATCH 0x00 -#define FIND_BEGINS 0x01 -#define FIND_ENDS 0x02 -#define FIND_CONTAINS 0x03 -#define FIND_CASESENSITIVE 0x04 -#define FIND_SENSITIVE FIND_CASESENSITIVE -#define FIND_AND 0x00 -#define FIND_OR 0x08 -#define FIND_NOT 0x10 -#define FIND_TRIM 0x20 - -// FindFirst constants - -#define faReadOnly 0x00000001 -#define faHidden 0x00000002 -#define faSysFile 0x00000004 -#define faVolumeID 0x00000008 -#define faDirectory 0x00000010 -#define faArchive 0x00000020 -#define faSymLink 0x00000040 -#define faAnyFile 0x0000003F - -// GetStringFileInfo standard names - -#define COMPANY_NAME "CompanyName" -#define FILE_DESCRIPTION "FileDescription" -#define FILE_VERSION "FileVersion" -#define INTERNAL_NAME "InternalName" -#define LEGAL_COPYRIGHT "LegalCopyright" -#define ORIGINAL_FILENAME "OriginalFilename" -#define PRODUCT_NAME "ProductName" -#define PRODUCT_VERSION "ProductVersion" - -// GetStringFileInfo helpers - -#define GetFileCompany(str FileName) GetStringFileInfo(FileName, COMPANY_NAME) -#define GetFileDescription(str FileName) GetStringFileInfo(FileName, FILE_DESCRIPTION) -#define GetFileVersionString(str FileName) GetStringFileInfo(FileName, FILE_VERSION) -#define GetFileCopyright(str FileName) GetStringFileInfo(FileName, LEGAL_COPYRIGHT) -#define GetFileOriginalFilename(str FileName) GetStringFileInfo(FileName, ORIGINAL_FILENAME) -#define GetFileProductVersion(str FileName) GetStringFileInfo(FileName, PRODUCT_VERSION) - -#define DeleteToFirstPeriod(str *S) \ - Local[1] = Copy(S, 1, (Local[0] = Pos(".", S)) - 1), \ - S = Copy(S, Local[0] + 1), \ - Local[1] - -#define GetVersionComponents(str FileName, *Major, *Minor, *Rev, *Build) \ - Local[1] = Local[0] = GetVersionNumbersString(FileName), \ - Local[1] == "" ? "" : ( \ - Major = Int(DeleteToFirstPeriod(Local[1])), \ - Minor = Int(DeleteToFirstPeriod(Local[1])), \ - Rev = Int(DeleteToFirstPeriod(Local[1])), \ - Build = Int(Local[1]), \ - Local[0]) - -#define GetPackedVersion(str FileName, *Version) \ - Local[0] = GetVersionComponents(FileName, Local[1], Local[2], Local[3], Local[4]), \ - Version = PackVersionComponents(Local[1], Local[2], Local[3], Local[4]), \ - Local[0] - -#define GetVersionNumbers(str FileName, *MS, *LS) \ - Local[0] = GetPackedVersion(FileName, Local[1]), \ - UnpackVersionNumbers(Local[1], MS, LS), \ - Local[0] - -#define PackVersionNumbers(int VersionMS, int VersionLS) \ - VersionMS << 32 | (VersionLS & 0xFFFFFFFF) - -#define PackVersionComponents(int Major, int Minor, int Rev, int Build) \ - Major << 48 | (Minor & 0xFFFF) << 32 | (Rev & 0xFFFF) << 16 | (Build & 0xFFFF) - -#define UnpackVersionNumbers(int Version, *VersionMS, *VersionLS) \ - VersionMS = Version >> 32, \ - VersionLS = Version & 0xFFFFFFFF, \ - void - -#define UnpackVersionComponents(int Version, *Major, *Minor, *Rev, *Build) \ - Major = Version >> 48, \ - Minor = (Version >> 32) & 0xFFFF, \ - Rev = (Version >> 16) & 0xFFFF, \ - Build = Version & 0xFFFF, \ - void - -#define VersionToStr(int Version) \ - Str(Version >> 48 & 0xFFFF) + "." + Str(Version >> 32 & 0xFFFF) + "." + \ - Str(Version >> 16 & 0xFFFF) + "." + Str(Version & 0xFFFF) - -#define StrToVersion(str Version) \ - Local[0] = Version, \ - Local[1] = Int(DeleteToFirstPeriod(Local[0])), \ - Local[2] = Int(DeleteToFirstPeriod(Local[0])), \ - Local[3] = Int(DeleteToFirstPeriod(Local[0])), \ - Local[4] = Int(Local[0]), \ - PackVersionComponents(Local[1], Local[2], Local[3], Local[4]) - -#define EncodeVer(int Major, int Minor, int Revision = 0, int Build = -1) \ - (Major & 0xFF) << 24 | (Minor & 0xFF) << 16 | (Revision & 0xFF) << 8 | (Build >= 0 ? Build & 0xFF : 0) - -#define DecodeVer(int Version, int Digits = 3) \ - Str(Version >> 24 & 0xFF) + (Digits > 1 ? "." : "") + \ - (Digits > 1 ? \ - Str(Version >> 16 & 0xFF) + (Digits > 2 ? "." : "") : "") + \ - (Digits > 2 ? \ - Str(Version >> 8 & 0xFF) + (Digits > 3 && (Local = Version & 0xFF) ? "." : "") : "") + \ - (Digits > 3 && Local ? \ - Str(Version & 0xFF) : "") - -#define FindSection(str Section = "Files") \ - Find(0, "[" + Section + "]", FIND_MATCH | FIND_TRIM) + 1 - -#if VER >= 0x03000000 -# define FindNextSection(int Line) \ - Find(Line, "[", FIND_BEGINS | FIND_TRIM, "]", FIND_ENDS | FIND_AND) -# define FindSectionEnd(str Section = "Files") \ - FindNextSection(FindSection(Section)) -#else -# define FindSectionEnd(str Section = "Files") \ - FindSection(Section) + EntryCount(Section) -#endif - -#define FindCode() \ - Local[1] = FindSection("Code"), \ - Local[0] = Find(Local[1] - 1, "program", FIND_BEGINS, ";", FIND_ENDS | FIND_AND), \ - (Local[0] < 0 ? Local[1] : Local[0] + 1) - -#define ExtractFilePath(str PathName) \ - (Local[0] = \ - !(Local[1] = RPos("\", PathName)) ? \ - "" : \ - Copy(PathName, 1, Local[1] - 1)), \ - Local[0] + \ - ((Local[2] = Len(Local[0])) == 2 && Copy(Local[0], Local[2]) == ":" ? \ - "\" : \ - "") - -#define ExtractFileDir(str PathName) \ - RemoveBackslash(ExtractFilePath(PathName)) - -#define ExtractFileExt(str PathName) \ - Local[0] = RPos(".", PathName), \ - Copy(PathName, Local[0] + 1) - -#define ExtractFileName(str PathName) \ - !(Local[0] = RPos("\", PathName)) ? \ - PathName : \ - Copy(PathName, Local[0] + 1) - -#define ChangeFileExt(str FileName, str NewExt) \ - !(Local[0] = RPos(".", FileName)) ? \ - FileName + "." + NewExt : \ - Copy(FileName, 1, Local[0]) + NewExt - -#define RemoveFileExt(str FileName) \ - !(Local[0] = RPos(".", FileName)) ? \ - FileName : \ - Copy(FileName, 1, Local[0] - 1) - -#define AddBackslash(str S) \ - Copy(S, Len(S)) == "\" ? S : S + "\" - -#define RemoveBackslash(str S) \ - Local[0] = Len(S), \ - Local[0] > 0 ? \ - Copy(S, Local[0]) == "\" ? \ - (Local[0] == 3 && Copy(S, 2, 1) == ":" ? \ - S : \ - Copy(S, 1, Local[0] - 1)) : \ - S : \ - "" - -#define Delete(str *S, int Index, int Count = MaxInt) \ - S = Copy(S, 1, Index - 1) + Copy(S, Index + Count) - -#define Insert(str *S, int Index, str Substr) \ - Index > Len(S) + 1 ? \ - S : \ - S = Copy(S, 1, Index - 1) + SubStr + Copy(S, Index) - -#define YesNo(str S) \ - (S = LowerCase(S)) == "yes" || S == "true" || S == "1" - -#define IsDirSet(str SetupDirective) \ - YesNo(SetupSetting(SetupDirective)) - -#define Power(int X, int P = 2) \ - !P ? 1 : X * Power(X, P - 1) - -#define Min(int A, int B, int C = MaxInt) \ - A < B ? A < C ? Int(A) : Int(C) : Int(B) - -#define Max(int A, int B, int C = MinInt) \ - A > B ? A > C ? Int(A) : Int(C) : Int(B) - -#define SameText(str S1, str S2) \ - LowerCase(S1) == LowerCase(S2) - -#define SameStr(str S1, str S2) \ - S1 == S2 - -#define WarnRenamedVersion(str OldName, str NewName) \ - Warning("Function """ + OldName + """ has been renamed. Use """ + NewName + """ instead.") - -#define ParseVersion(str FileName, *Major, *Minor, *Rev, *Build) \ - WarnRenamedVersion("ParseVersion", "GetVersionComponents"), \ - GetVersionComponents(FileName, Major, Minor, Rev, Build) - -#define GetFileVersion(str FileName) \ - WarnRenamedVersion("GetFileVersion", "GetVersionNumbersString"), \ - GetVersionNumbersString(FileName) - -#ifdef DisablePOptP -# pragma parseroption -p- -#endif - -#ifdef EnableOptE -# pragma option -e+ -#endif -#endif \ No newline at end of file diff --git a/native/windows/inno-setup/ISetup.chm b/native/windows/inno-setup/ISetup.chm deleted file mode 100644 index 4021475e5..000000000 Binary files a/native/windows/inno-setup/ISetup.chm and /dev/null differ diff --git a/native/windows/inno-setup/LICENSE b/native/windows/inno-setup/LICENSE deleted file mode 100644 index c74bb0bdf..000000000 --- a/native/windows/inno-setup/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -Inno Setup License -================== - -Except where otherwise noted, all of the documentation and software included in the Inno Setup -package is copyrighted by Jordan Russell. - -Copyright (C) 1997-2022 Jordan Russell. All rights reserved. -Portions Copyright (C) 2000-2022 Martijn Laan. All rights reserved. - -This software is provided "as-is," without any express or implied warranty. In no event shall the -author be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial -applications, and to alter and redistribute it, provided that the following conditions are met: - -1. All redistributions of source code files must retain all copyright notices that are currently in - place, and this list of conditions without modification. - -2. All redistributions in binary form must retain all occurrences of the above copyright notice and - web site addresses that are currently in place (for example, in the About boxes). - -3. The origin of this software must not be misrepresented; you must not claim that you wrote the - original software. If you use this software to distribute a product, an acknowledgment in the - product documentation would be appreciated but is not required. - -4. Modified versions in source or binary form must be plainly marked as such, and must not be - misrepresented as being the original software. - - -Jordan Russell -jr-2020 AT jrsoftware.org -https://jrsoftware.org/ \ No newline at end of file diff --git a/native/windows/inno-setup/Setup.e32 b/native/windows/inno-setup/Setup.e32 deleted file mode 100644 index f4c7220a0..000000000 Binary files a/native/windows/inno-setup/Setup.e32 and /dev/null differ diff --git a/native/windows/inno-setup/SetupClassicIcon.ico b/native/windows/inno-setup/SetupClassicIcon.ico deleted file mode 100644 index b274e4c68..000000000 Binary files a/native/windows/inno-setup/SetupClassicIcon.ico and /dev/null differ diff --git a/native/windows/inno-setup/SetupLdr.e32 b/native/windows/inno-setup/SetupLdr.e32 deleted file mode 100644 index 50a45bdae..000000000 Binary files a/native/windows/inno-setup/SetupLdr.e32 and /dev/null differ diff --git a/native/windows/inno-setup/WizClassicImage-IS.bmp b/native/windows/inno-setup/WizClassicImage-IS.bmp deleted file mode 100644 index cf844e093..000000000 Binary files a/native/windows/inno-setup/WizClassicImage-IS.bmp and /dev/null differ diff --git a/native/windows/inno-setup/WizClassicImage.bmp b/native/windows/inno-setup/WizClassicImage.bmp deleted file mode 100644 index cb05a0632..000000000 Binary files a/native/windows/inno-setup/WizClassicImage.bmp and /dev/null differ diff --git a/native/windows/inno-setup/WizClassicSmallImage-IS.bmp b/native/windows/inno-setup/WizClassicSmallImage-IS.bmp deleted file mode 100644 index 1e8e49792..000000000 Binary files a/native/windows/inno-setup/WizClassicSmallImage-IS.bmp and /dev/null differ diff --git a/native/windows/inno-setup/WizClassicSmallImage.bmp b/native/windows/inno-setup/WizClassicSmallImage.bmp deleted file mode 100644 index 63f421040..000000000 Binary files a/native/windows/inno-setup/WizClassicSmallImage.bmp and /dev/null differ diff --git a/native/windows/inno-setup/isbunzip.dll b/native/windows/inno-setup/isbunzip.dll deleted file mode 100644 index 814e86801..000000000 Binary files a/native/windows/inno-setup/isbunzip.dll and /dev/null differ diff --git a/native/windows/inno-setup/isbzip.dll b/native/windows/inno-setup/isbzip.dll deleted file mode 100644 index 1afeefd54..000000000 Binary files a/native/windows/inno-setup/isbzip.dll and /dev/null differ diff --git a/native/windows/inno-setup/islzma.dll b/native/windows/inno-setup/islzma.dll deleted file mode 100644 index 81fd05ac6..000000000 Binary files a/native/windows/inno-setup/islzma.dll and /dev/null differ diff --git a/native/windows/inno-setup/islzma32.exe b/native/windows/inno-setup/islzma32.exe deleted file mode 100644 index 7562645e2..000000000 Binary files a/native/windows/inno-setup/islzma32.exe and /dev/null differ diff --git a/native/windows/inno-setup/islzma64.exe b/native/windows/inno-setup/islzma64.exe deleted file mode 100644 index fd58a59e0..000000000 Binary files a/native/windows/inno-setup/islzma64.exe and /dev/null differ diff --git a/native/windows/inno-setup/isscint.dll b/native/windows/inno-setup/isscint.dll deleted file mode 100644 index 5f8ef49b7..000000000 Binary files a/native/windows/inno-setup/isscint.dll and /dev/null differ diff --git a/native/windows/inno-setup/isunzlib.dll b/native/windows/inno-setup/isunzlib.dll deleted file mode 100644 index 8c4ed5101..000000000 Binary files a/native/windows/inno-setup/isunzlib.dll and /dev/null differ diff --git a/native/windows/inno-setup/iszlib.dll b/native/windows/inno-setup/iszlib.dll deleted file mode 100644 index b326e3a7d..000000000 Binary files a/native/windows/inno-setup/iszlib.dll and /dev/null differ diff --git a/native/windows/legup_inno_setup.iss b/native/windows/legup_inno_setup.iss deleted file mode 100644 index f85c7abdd..000000000 --- a/native/windows/legup_inno_setup.iss +++ /dev/null @@ -1,55 +0,0 @@ -; =========================================================================== -; | This implementation uses a standalone Legup.exe generated by launch4j. -; | Change MyJava below to match the path to the latest JRE version that -; | you have installed on your system. -; =========================================================================== - - -#define MyAppName "Legup" -#define MyAppVersion "3.0" -#define MyAppPublisher "Bram Hub" -#define MyAppURL "https://github.com/Bram-Hub/Legup/" -#define MyAppExeName "Legup.exe" -#define MyAppRoot "..\.." - -; ************* CHANGE ME!!!! ************* -#define MyJava "C:\Program Files\Java\jre1.8.0_333\" - -[Setup] -; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. -AppId={{A401504E-CBDA-4839-A782-980FC0C036D3} -AppName={#MyAppName} -AppVersion={#MyAppVersion} -;AppVerName={#MyAppName} {#MyAppVersion} -AppPublisher={#MyAppPublisher} -AppPublisherURL={#MyAppURL} -AppSupportURL={#MyAppURL} -AppUpdatesURL={#MyAppURL} -DefaultDirName={autopf}\{#MyAppName} -DisableProgramGroupPage=yes -; Uncomment the following line to run in non administrative install mode (install for current user only.) -PrivilegesRequired=lowest -OutputDir=bin -OutputBaseFilename=legup_installer -Compression=lzma -SolidCompression=yes -WizardStyle=modern - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked - -[Files] -Source: "{#MyAppRoot}\native\windows\bin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -;Source: "{#MyAppRoot}\build\libs\Legup.jar"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyJava}*"; DestDir: "{app}\jre"; Flags: ignoreversion recursesubdirs createallsubdirs - -[Icons] -Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon - -[Run] -Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent - diff --git a/native/windows/legup_launch4j.xml b/native/windows/legup_launch4j.xml deleted file mode 100644 index 19d6215be..000000000 --- a/native/windows/legup_launch4j.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - true - gui - Legup.jar - C:\Users\Trevor\IdeaProjects\Legup\native\windows\bin\Legup.exe - - - . - normal - http://java.com/download - - false - false - - - - jre - true - false - 1.8.0_121 - - preferJre - 64/32 - - \ No newline at end of file diff --git a/native/windows/make_windows_installer.bat b/native/windows/make_windows_installer.bat deleted file mode 100644 index 6c0e55115..000000000 --- a/native/windows/make_windows_installer.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -inno-setup\ISCC.exe legup_inno_setup.iss \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/history/AutoCaseRuleCommand.java b/src/main/java/edu/rpi/legup/history/AutoCaseRuleCommand.java index 54e33756a..97192e145 100644 --- a/src/main/java/edu/rpi/legup/history/AutoCaseRuleCommand.java +++ b/src/main/java/edu/rpi/legup/history/AutoCaseRuleCommand.java @@ -23,8 +23,6 @@ public class AutoCaseRuleCommand extends PuzzleCommand { private List caseTrans; - private static final int MAX_CASES = 10; - /** * AutoCaseRuleCommand Constructor creates a command for validating a case rule * @@ -118,9 +116,14 @@ public String getErrorString() { return "The selection must produce at least one case"; } - if (caseRule.getCases(caseBoard.getBaseBoard(), elementView.getPuzzleElement()).size() - > MAX_CASES) { - return "The selection can produce a max of " + MAX_CASES + " cases"; + int numberOfCaseRules = + caseRule.getCases(caseBoard.getBaseBoard(), elementView.getPuzzleElement()).size(); + System.out.println("Number of cases:" + numberOfCaseRules); + if (numberOfCaseRules > caseRule.MAX_CASES) { + return "The selection can produce a max of " + caseRule.MAX_CASES + " cases"; + } + if (numberOfCaseRules < caseRule.MIN_CASES) { + return "The selection must produce a minimum of " + caseRule.MIN_CASES + " cases"; } return null; diff --git a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java new file mode 100644 index 000000000..c41d5e1b2 --- /dev/null +++ b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java @@ -0,0 +1,55 @@ +package edu.rpi.legup.model.gameboard; + +import java.util.ArrayList; +import java.util.List; + +public abstract class GridRegion { + + protected List regionCells; + + /** Region Constructor */ + public GridRegion() { + this.regionCells = new ArrayList<>(); + } + + /** + * Adds the cell to the region + * + * @param cell cell to be added to the region + */ + public void addCell(T cell) { + regionCells.add(cell); + } + + /** + * Removes the cell from the region + * + * @param cell cell to be remove from the region + */ + public void removeCell(T cell) { + regionCells.remove(cell); + } + + /** + * Returns the list of cells in the region + * + * @return list of cells in region + */ + public List getCells() { + return regionCells; + } + + /** + * Returns the number of cells in the region + * + * @return number of cells in the region + */ + public int getSize() { + return regionCells.size(); + } + + /* + public void colorRegion(){} + */ + +} diff --git a/src/main/java/edu/rpi/legup/model/rules/CaseRule.java b/src/main/java/edu/rpi/legup/model/rules/CaseRule.java index e87896fcc..ab2cc8f0d 100644 --- a/src/main/java/edu/rpi/legup/model/rules/CaseRule.java +++ b/src/main/java/edu/rpi/legup/model/rules/CaseRule.java @@ -14,6 +14,8 @@ public abstract class CaseRule extends Rule { private final String INVALID_USE_MESSAGE; + public int MAX_CASES; + public int MIN_CASES; /** * CaseRule Constructor creates a new case rule. @@ -27,6 +29,8 @@ public CaseRule(String ruleID, String ruleName, String description, String image super(ruleID, ruleName, description, imageName); this.ruleType = CASE; this.INVALID_USE_MESSAGE = "Invalid use of the case rule " + this.ruleName; + this.MAX_CASES = 10; + this.MIN_CASES = 1; // By default, this will not actually have any effect } /** @@ -68,7 +72,6 @@ public String checkRule(TreeTransition transition) { return "All children nodes must be justified with the same case rule."; } } - String check = checkRuleRaw(transition); // Mark transition and new data as valid or not diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/SatisfyNumberCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/SatisfyNumberCaseRule.java index ac656721d..490122874 100644 --- a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/SatisfyNumberCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/SatisfyNumberCaseRule.java @@ -188,8 +188,28 @@ public String checkRuleRaw(TreeTransition transition) { for (LightUpCell c : spots) { ArrayList cases = getCases(parent.getBoard(), c); - // We will allow case rules to have only one option - if (cases.size() == childTransitions.size() && cases.size() >= 1) { + // Note: we will allow case rules to have only one option + + // Some error checking to make sure that weird stuff doesn't happen + // if this case rule is incorrectly used to justify changes on the + // puzzle board + if (cases.size() == childTransitions.size() && cases.size() == 1) { + TreeTransition childTransition = childTransitions.get(0); + + // If there is only 1 case, then this case rule should function no + // differently than the Finish With Bulbs Direct Rule + FinishWithBulbsDirectRule finishWithBulbs = new FinishWithBulbsDirectRule(); + childTransition.setRule(finishWithBulbs); + boolean isCorrect = childTransition.isCorrect(); + + // Changes the transition back to this case rule + childTransition.setRule(this); + + if (isCorrect) { + return null; + } + return super.getInvalidUseOfRuleMessage(); + } else if (cases.size() == childTransitions.size() && cases.size() > 1) { boolean foundSpot = true; for (TreeTransition childTrans : childTransitions) { LightUpBoard actCase = (LightUpBoard) childTrans.getBoard(); diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackOrWhiteCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackOrWhiteCaseRule.java index fe1ffcf91..ac0ab6df6 100644 --- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackOrWhiteCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackOrWhiteCaseRule.java @@ -19,6 +19,7 @@ public BlackOrWhiteCaseRule() { "Black or White", "Each blank cell is either black or white.", "edu/rpi/legup/images/nurikabe/cases/BlackOrWhite.png"); + this.MAX_CASES = 2; } /** diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FinishRoomCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FinishRoomCaseRule.java new file mode 100644 index 000000000..4901cfa6f --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FinishRoomCaseRule.java @@ -0,0 +1,249 @@ +package edu.rpi.legup.puzzle.nurikabe.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.CaseBoard; +import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.model.rules.CaseRule; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard; +import edu.rpi.legup.puzzle.nurikabe.NurikabeCell; +import edu.rpi.legup.puzzle.nurikabe.NurikabeType; +import edu.rpi.legup.puzzle.nurikabe.NurikabeUtilities; +import edu.rpi.legup.utility.DisjointSets; +import java.awt.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class FinishRoomCaseRule extends CaseRule { + private int legitCases = + 0; // placeholder for amount of cases originally generated in case user tries to delete + + // cases + + public FinishRoomCaseRule() { + super( + "NURI-CASE-0002", + "Finish Room", + "Room can be finished in up to five ways", + "edu/rpi/legup/images/nurikabe/cases/FinishRoom.png"); + this.MAX_CASES = 5; + this.MIN_CASES = 2; + } + + /** + * Checks whether the {@link TreeTransition} logically follows from the parent node using this + * rule. This method is the one that should overridden in child classes. + * + * @param transition transition to check + * @return null if the child node logically follow from the parent node, otherwise error message + */ + @Override + public String checkRuleRaw(TreeTransition transition) { + NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard(); + List childTransitions = transition.getParents().get(0).getChildren(); + if (childTransitions.size() > 5) { + return super.getInvalidUseOfRuleMessage() + + ": This case rule must have 5 or less children."; + } + if (childTransitions.size() < 2) { + return super.getInvalidUseOfRuleMessage() + + ": This case rule must have 2 or more children."; + } + if (childTransitions.size() != legitCases) { + return super.getInvalidUseOfRuleMessage() + + ": Cases can not be removed from the branch."; + } // stops user from deleting 1 or mose generated cases and still having path show as green + Set locations = new HashSet<>(); + for (TreeTransition t1 : childTransitions) { + locations.add( + ((NurikabeCell) t1.getBoard().getModifiedData().iterator().next()) + .getLocation()); // loop see if matches + if (t1.getBoard().getModifiedData().size() != 1) { + return super.getInvalidUseOfRuleMessage() + + ": This case rule must have 1 modified cell for each case."; + } + for (Point loc : locations) { + for (Point loc2 : locations) { + if (!(loc.equals(loc2)) && (loc.x == loc2.x) && (loc.y == loc2.y)) { + return super.getInvalidUseOfRuleMessage() + + ": This case rule must alter a different cell for each case."; + } + } + } + } + + return null; + } + + @Override + public CaseBoard getCaseBoard(Board board) { + NurikabeBoard nurikabeBoard = (NurikabeBoard) board.copy(); + CaseBoard caseBoard = new CaseBoard(nurikabeBoard, this); + DisjointSets regions = NurikabeUtilities.getNurikabeRegions(nurikabeBoard); + nurikabeBoard.setModifiable(false); + + for (PuzzleElement element : + nurikabeBoard.getPuzzleElements()) { // loops all puzzle elements + if (((NurikabeCell) element).getType() + == NurikabeType.NUMBER) { // if the tile is a white number block + Set disRow = + regions.getSet( + ((NurikabeCell) element)); // store the row of the white region + boolean only = + true; // placeholder boolean of if the element being tested is the only + // number block in the room or not + for (NurikabeCell d : disRow) { // loops through tiles in the room + if ((d.getType() == NurikabeType.NUMBER) + && !(d.getData() + .equals( + ((NurikabeCell) element) + .getData()))) { // if found another number tile + // and it's data is different + // than the element we're + // working with + only = false; // set only to false + } + } + if (disRow.size() + 1 == ((NurikabeCell) element).getData() + && only) { // if size of region is 1 less than the number block and the + // number block is only number block in the region + caseBoard.addPickableElement(element); // add that room as a pickable element + } + } + } + return caseBoard; + } + + /** + * Gets the possible cases at a specific location based on this case rule + * + * @param board the current board state + * @param puzzleElement equivalent puzzleElement + * @return a list of elements the specified could be + */ + @Override + public ArrayList getCases(Board board, PuzzleElement puzzleElement) { + ArrayList cases = new ArrayList<>(); // makes array list of cases + NurikabeBoard nuriBoard = (NurikabeBoard) board.copy(); // nurikabe board to edit + NurikabeCell numbaCell = + nuriBoard.getCell( + ((NurikabeCell) puzzleElement).getLocation().x, + ((NurikabeCell) puzzleElement) + .getLocation() + .y); // number cell whose room we want to fill + int filledRoomSize = numbaCell.getData(); // size of room we want afterward + Set locations = + new HashSet<>(); // locations where white space is added to finish room + Point left = new Point(-1, 0); + Point right = new Point(1, 0); + Point bot = new Point(0, -1); + Point top = new Point(0, 1); + Set directions = new HashSet<>(); + directions.add(left); + directions.add(right); + directions.add(top); + directions.add(bot); + Set checkedPoints = + new HashSet<>(); // add all into checked points and continue at start of loop if + // inside + DisjointSets regions = + NurikabeUtilities.getNurikabeRegions(nuriBoard); // gathers regions + Set disRow = regions.getSet(numbaCell); // set of white spaces + for (NurikabeCell d : disRow) { // loops through white spaces + if (cases.size() >= 6) { // no need to check this many cases + // throw new IllegalStateException("Too many cases"); + continue; // crash/runtime protection + } + for (Point direction : directions) { + if (cases.size() >= 6) { // no need to check this many cases + // throw new IllegalStateException("Too many cases"); + continue; // crash/runtime protection + } + if (!((nuriBoard.getWidth() > (d.getLocation().x + direction.x) + && (nuriBoard.getHeight() > d.getLocation().y + direction.y) + && (d.getLocation().x + direction.x >= 0) + && (d.getLocation().y + direction.y >= 0)))) { + continue; // if next location check would be outside of grid then continue + } + NurikabeCell curr = + nuriBoard.getCell( + d.getLocation().x + direction.x, d.getLocation().y + direction.y); + if (checkedPoints.contains(curr.getLocation())) { + continue; // if we already checked whether or not making this tile white would + // complete the room then continue + } + checkedPoints.add( + curr.getLocation()); // adds location to checkedPoints so we don't check + // it again and accidentally add + if (curr.getType() + == NurikabeType + .UNKNOWN) { // found adjacent space to region that is currently + // unknown + curr.setData( + NurikabeType.WHITE.toValue()); // changes adjacent cell color to white + nuriBoard.addModifiedData(curr); // adds modified before check + regions = NurikabeUtilities.getNurikabeRegions(nuriBoard); // update regions + Set disCreatedRow = + regions.getSet( + curr); // gets set of created row with new white cell added + if (disCreatedRow.size() + == filledRoomSize) { // If adding white fills the room to exact size of + // number block and doesn't connect with another + // room + Point here = curr.getLocation(); // gets current location of new white tile + // that fills room + boolean alreadyIn = + false; // sets whether or not the tile has already been added to + // false + for (Point p : + locations) { // loops through locations of previously added tiles + if (p == here) { // if point is already in + alreadyIn = true; // change already in to true + break; + } + } + if (!alreadyIn) { // if point wasn't already in + Board casey = + nuriBoard.copy(); // copy the current board with white tile + // changed + PuzzleElement datacasey = + curr; // gets changed white tile as a puzzle element + datacasey.setData( + NurikabeType.WHITE + .toValue()); // ensure set to white, probably redundant + casey.addModifiedData(datacasey); // ensure confirmed white change + regions = + NurikabeUtilities.getNurikabeRegions( + nuriBoard); // update regions + cases.add(casey); // add this case to list of cases + locations.add( + here); // add location of new white tile to list of locations so + // that we don't accidentally add it again later + } + } + curr.setData(NurikabeType.UNKNOWN.toValue()); // set cell type back to unknown + nuriBoard.addModifiedData(curr); // confirms change back to unknown + regions = NurikabeUtilities.getNurikabeRegions(nuriBoard); // updates regions + } + } + legitCases = cases.size(); + } + return cases; + } + + /** + * Checks whether the child node logically follows from the parent node at the specific + * puzzleElement index using this rule + * + * @param transition transition to check + * @param puzzleElement equivalent puzzleElement + * @return null if the child node logically follow from the parent node at the specified + * puzzleElement, otherwise error message + */ + @Override + public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { + return null; + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/nurikabe_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/nurikabe_reference_sheet.txt index 6a6e6bc1f..596de7819 100644 --- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/nurikabe_reference_sheet.txt +++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/nurikabe_reference_sheet.txt @@ -16,4 +16,5 @@ NURI-CONT-0005 : NoNumberContradictionRule NURI-CONT-0006 : TooFewSpacesContradictionRule NURI-CONT-0007 : TooManySpacesContradictionRule -NURI-CASE-0001 : BlackOrWhiteCaseRule \ No newline at end of file +NURI-CASE-0001 : BlackOrWhiteCaseRule +NURI-CASE-0002 : FinishRoomCaseRule \ No newline at end of file diff --git a/src/main/resources/edu/rpi/legup/images/nurikabe/cases/FinishRoom.png b/src/main/resources/edu/rpi/legup/images/nurikabe/cases/FinishRoom.png new file mode 100644 index 000000000..207d4c820 Binary files /dev/null and b/src/main/resources/edu/rpi/legup/images/nurikabe/cases/FinishRoom.png differ diff --git a/src/test/java/legup/TestRunner.java b/src/test/java/legup/TestRunner.java index 40cc5fa6c..8661f0e69 100644 --- a/src/test/java/legup/TestRunner.java +++ b/src/test/java/legup/TestRunner.java @@ -18,7 +18,7 @@ public static void main(String[] args) { Result result2 = JUnitCore.runClasses(FinishWithShipsDirectRuleTests.class); printTestResults(result2); - // Lightup Tests + // LightUp Tests Result result3 = JUnitCore.runClasses(BulbsInPathContradictionRuleTest.class); printTestResults(result3); Result result4 = JUnitCore.runClasses(CannotLightACellContradictionRuleTest.class); @@ -29,68 +29,70 @@ public static void main(String[] args) { printTestResults(result6); Result result7 = JUnitCore.runClasses(FinishWithBulbsDirectRuleTest.class); printTestResults(result7); - Result result8 = JUnitCore.runClasses(LightOrEmptyCaseRuleTest.class); + Result result8 = JUnitCore.runClasses(FinishWithEmptyDirectRuleTest.class); printTestResults(result8); - Result result9 = JUnitCore.runClasses(MustLightDirectRuleTest.class); + Result result9 = JUnitCore.runClasses(LightOrEmptyCaseRuleTest.class); printTestResults(result9); - Result result10 = JUnitCore.runClasses(SatisfyNumberCaseRuleTest.class); + Result result10 = JUnitCore.runClasses(MustLightDirectRuleTest.class); printTestResults(result10); - Result result11 = JUnitCore.runClasses(TooFewBulbsContradictionRuleTest.class); + Result result11 = JUnitCore.runClasses(SatisfyNumberCaseRuleTest.class); printTestResults(result11); - Result result12 = JUnitCore.runClasses(TooManyBulbsContradictionRuleTest.class); + Result result12 = JUnitCore.runClasses(TooFewBulbsContradictionRuleTest.class); printTestResults(result12); + Result result13 = JUnitCore.runClasses(TooManyBulbsContradictionRuleTest.class); + printTestResults(result13); // nurikabe tests - Result result13 = JUnitCore.runClasses(BlackBetweenRegionsDirectRuleTest.class); - printTestResults(result13); - Result result14 = JUnitCore.runClasses(BlackBottleNeckDirectRuleTest.class); + Result result14 = JUnitCore.runClasses(BlackBetweenRegionsDirectRuleTest.class); printTestResults(result14); - Result result15 = JUnitCore.runClasses(BlackOrWhiteCaseRuleTest.class); + Result result15 = JUnitCore.runClasses(BlackBottleNeckDirectRuleTest.class); printTestResults(result15); - Result result16 = JUnitCore.runClasses(BlackSquareContradictionRuleTest.class); + Result result16 = JUnitCore.runClasses(BlackOrWhiteCaseRuleTest.class); printTestResults(result16); - Result result17 = JUnitCore.runClasses(CornerBlackDirectRuleTest.class); + Result result17 = JUnitCore.runClasses(BlackSquareContradictionRuleTest.class); printTestResults(result17); - Result result18 = JUnitCore.runClasses(FillinBlackDirectRuleTest.class); + Result result18 = JUnitCore.runClasses(CornerBlackDirectRuleTest.class); printTestResults(result18); - Result result19 = JUnitCore.runClasses(FillinWhiteDirectRuleTest.class); + Result result19 = JUnitCore.runClasses(FillinBlackDirectRuleTest.class); printTestResults(result19); - Result result20 = JUnitCore.runClasses(IsolateBlackContradictionRuleTest.class); + Result result20 = JUnitCore.runClasses(FillinWhiteDirectRuleTest.class); printTestResults(result20); - Result result21 = JUnitCore.runClasses(MultipleNumbersContradictionRuleTest.class); + Result result21 = JUnitCore.runClasses(IsolateBlackContradictionRuleTest.class); printTestResults(result21); - Result result22 = JUnitCore.runClasses(NoNumbersContradictionRuleTest.class); + Result result22 = JUnitCore.runClasses(MultipleNumbersContradictionRuleTest.class); printTestResults(result22); - Result result23 = JUnitCore.runClasses(PreventBlackSquareDirectRuleTest.class); + Result result23 = JUnitCore.runClasses(NoNumbersContradictionRuleTest.class); printTestResults(result23); - Result result24 = JUnitCore.runClasses(SurroundRegionDirectRuleTest.class); + Result result24 = JUnitCore.runClasses(PreventBlackSquareDirectRuleTest.class); printTestResults(result24); - Result result25 = JUnitCore.runClasses(TooFewSpacesContradictionRuleTest.class); + Result result25 = JUnitCore.runClasses(SurroundRegionDirectRuleTest.class); printTestResults(result25); - Result result26 = JUnitCore.runClasses(TooManySpacesContradictionRuleTest.class); + Result result26 = JUnitCore.runClasses(TooFewSpacesContradictionRuleTest.class); printTestResults(result26); - Result result27 = JUnitCore.runClasses(WhiteBottleNeckDirectRuleTest.class); + Result result27 = JUnitCore.runClasses(TooManySpacesContradictionRuleTest.class); printTestResults(result27); + Result result28 = JUnitCore.runClasses(WhiteBottleNeckDirectRuleTest.class); + printTestResults(result28); // Treetent - Result result28 = JUnitCore.runClasses(EmptyFieldDirectRuleTest.class); - printTestResults(result28); - Result result29 = JUnitCore.runClasses(FinishWithGrassDirectRuleTest.class); + Result result29 = JUnitCore.runClasses(EmptyFieldDirectRuleTest.class); printTestResults(result29); - Result result30 = JUnitCore.runClasses(FinishWithTentsDirectRuleTest.class); + Result result30 = JUnitCore.runClasses(FinishWithGrassDirectRuleTest.class); printTestResults(result30); - Result result31 = JUnitCore.runClasses(LastCampingSpotDirectRuleTest.class); + Result result31 = JUnitCore.runClasses(FinishWithTentsDirectRuleTest.class); printTestResults(result31); - Result result32 = JUnitCore.runClasses(NoTentForTreeContradictionRuleTest.class); + Result result32 = JUnitCore.runClasses(LastCampingSpotDirectRuleTest.class); printTestResults(result32); - Result result33 = JUnitCore.runClasses(NoTreeForTentContradictionRuleTest.class); + Result result33 = JUnitCore.runClasses(NoTentForTreeContradictionRuleTest.class); printTestResults(result33); - Result result34 = JUnitCore.runClasses(SurroundTentWithGrassDirectRuleTest.class); + Result result34 = JUnitCore.runClasses(NoTreeForTentContradictionRuleTest.class); printTestResults(result34); - Result result35 = JUnitCore.runClasses(TreeForTentDirectRuleTest.class); + Result result35 = JUnitCore.runClasses(SurroundTentWithGrassDirectRuleTest.class); printTestResults(result35); - Result result36 = JUnitCore.runClasses(TentOrGrassCaseRuleTest.class); + Result result36 = JUnitCore.runClasses(TreeForTentDirectRuleTest.class); printTestResults(result36); + Result result37 = JUnitCore.runClasses(TentOrGrassCaseRuleTest.class); + printTestResults(result37); } private static void printTestResults(Result result) { diff --git a/src/test/java/puzzles/lightup/rules/FinishWithEmptyDirectRuleTest.java b/src/test/java/puzzles/lightup/rules/FinishWithEmptyDirectRuleTest.java new file mode 100644 index 000000000..079641ee7 --- /dev/null +++ b/src/test/java/puzzles/lightup/rules/FinishWithEmptyDirectRuleTest.java @@ -0,0 +1,105 @@ +package puzzles.lightup.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.lightup.LightUp; +import edu.rpi.legup.puzzle.lightup.LightUpBoard; +import edu.rpi.legup.puzzle.lightup.LightUpCell; +import edu.rpi.legup.puzzle.lightup.LightUpCellType; +import edu.rpi.legup.puzzle.lightup.rules.FinishWithEmptyDirectRule; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class FinishWithEmptyDirectRuleTest { + private static final FinishWithEmptyDirectRule RULE = new FinishWithEmptyDirectRule(); + private static LightUp lightUp; + + @BeforeClass + public static void setUp() { + lightUp = new LightUp(); + } + + @Test + public void FinishEmptyTestWithOne() throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/lightup/rules/FinishWithEmptyDirectRule/FinishWithEmptyWithOne", lightUp); + TreeNode rootNode = lightUp.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + // get board state + LightUpBoard board = (LightUpBoard) transition.getBoard(); + // The board has a "1" clue at (1,1) with a bulb one space above at (1,0); + + // change the board's cells considering the FinishWithEmpty rule to empty + LightUpCell cell1 = board.getCell(0, 1); // left + cell1.setData(LightUpCellType.EMPTY.value); + board.addModifiedData(cell1); + + LightUpCell cell2 = board.getCell(2, 1); // right + cell2.setData(LightUpCellType.EMPTY.value); + board.addModifiedData(cell2); + + LightUpCell cell3 = board.getCell(1, 2); // below + cell3.setData(LightUpCellType.EMPTY.value); + board.addModifiedData(cell3); + + // confirm there is a logical following of the FinishWithEmpty rule + Assert.assertNull(RULE.checkRule(transition)); + + // check every square except the top center (2,0) + LightUpCell c; + for (int i = 0; i < board.getHeight(); i++) { + for (int j = 0; j < board.getWidth(); j++) { + c = board.getCell(j, i); + if ((i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1)) { + // logically follows + Assert.assertNull(RULE.checkRuleAt(transition, c)); + } else { + // does not use the rule to logically follow + Assert.assertNotNull(RULE.checkRuleAt(transition, c)); + } + } + } + } + + @Test + public void FinishEmptyTestWithThree() throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/lightup/rules/FinishWithEmptyDirectRule/FinishWithEmptyWithThree", + lightUp); + TreeNode rootNode = lightUp.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + // get board state + LightUpBoard board = (LightUpBoard) transition.getBoard(); + // The board has a "3" clue at (1,1) with a bulbs at (0,1), (2,1), and (1,2) + + // change the board's cells considering the FinishWithBulbs rule to empty + LightUpCell cell1 = board.getCell(1, 0); + cell1.setData(LightUpCellType.EMPTY.value); + board.addModifiedData(cell1); + + // confirm there is a logical following of the FinishWithBulbs rule + Assert.assertNull(RULE.checkRule(transition)); + + // check every square for logical following + LightUpCell c; + for (int i = 0; i < board.getHeight(); i++) { + for (int j = 0; j < board.getWidth(); j++) { + c = board.getCell(j, i); + if (i == 0 && j == 1) { + // logically follows + Assert.assertNull(RULE.checkRuleAt(transition, c)); + } else { + // does not use the rule to logically follow + Assert.assertNotNull(RULE.checkRuleAt(transition, c)); + } + } + } + } +} diff --git a/src/test/java/puzzles/nurikabe/rules/FinishRoomCaseRuleTest.java b/src/test/java/puzzles/nurikabe/rules/FinishRoomCaseRuleTest.java new file mode 100644 index 000000000..5f5b6d35a --- /dev/null +++ b/src/test/java/puzzles/nurikabe/rules/FinishRoomCaseRuleTest.java @@ -0,0 +1,114 @@ +package puzzles.nurikabe.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.nurikabe.*; +import edu.rpi.legup.puzzle.nurikabe.rules.FinishRoomCaseRule; +import edu.rpi.legup.save.InvalidFileFormatException; +import edu.rpi.legup.utility.DisjointSets; +import java.awt.*; +import java.util.ArrayList; +import java.util.Set; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class FinishRoomCaseRuleTest { + + private static final FinishRoomCaseRule RULE = new FinishRoomCaseRule(); + private static Nurikabe nurikabe; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + nurikabe = new Nurikabe(); + } + + /** + * Tests the Finish Room case rule by ensuring that it results in 5 or less children, that + * contain a modified cell that is white + */ + @Test + public void FinishRoomCaseRule_FinishRoomCaseRuleBaseTest() throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/nurikabe/rules/FinishRoomCaseRule/FinishRoomCaseRuleBase", nurikabe); + TreeNode rootNode = nurikabe.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + NurikabeBoard board = (NurikabeBoard) transition.getBoard(); + NurikabeCell cell = board.getCell(6, 4); + ArrayList cases = RULE.getCases(board, cell); + Assert.assertEquals(2, cases.size()); + + NurikabeBoard caseBoard = (NurikabeBoard) cases.get(0); + NurikabeBoard caseBoard2 = (NurikabeBoard) cases.get(1); + + NurikabeType board1Type = caseBoard.getCell(5, 5).getType(); + NurikabeType board2Type = caseBoard2.getCell(6, 6).getType(); + + Assert.assertTrue( + (board1Type.equals(NurikabeType.WHITE) && board2Type.equals(NurikabeType.WHITE))); + + Assert.assertEquals(caseBoard.getHeight(), caseBoard2.getHeight(), board.getHeight()); + Assert.assertEquals(caseBoard.getWidth(), caseBoard2.getWidth(), board.getWidth()); + + DisjointSets regions = + NurikabeUtilities.getNurikabeRegions(caseBoard); // gathers regions + Set disRow = regions.getSet(caseBoard.getCell(5, 5)); + Assert.assertEquals(disRow.size(), 3); + + DisjointSets regions2 = + NurikabeUtilities.getNurikabeRegions(caseBoard2); // gathers regions + Set disRow2 = regions2.getSet(caseBoard2.getCell(6, 6)); + Assert.assertEquals(disRow2.size(), 3); + + for (int i = 0; i < caseBoard.getHeight(); i++) { + for (int k = 0; k < caseBoard.getWidth(); k++) { + Point point = new Point(k, i); + if (point.equals(caseBoard.getCell(k, i).getLocation())) { + continue; + } + Assert.assertTrue( + caseBoard.getCell(k, i).equals(caseBoard2.getCell(k, i)) + || caseBoard2.getCell(k, i).equals(caseBoard2.getCell(k, i))); + } + } + + NurikabeCell cell2 = board.getCell(4, 2); + ArrayList cases2 = RULE.getCases(board, cell2); + + Assert.assertEquals(6, cases2.size()); // correctly stops generating possible cases after + // more than 5 (the max) is found. Would have generated 8 cases + // FinishRoomCaseRule finny = new FinishRoomCaseRule(); + // finny.checkRuleRaw(); + // "Invalid use of the case rule FinishRoom: This case rule must have 5 or less children." + + // getErrorString in auto case rule + // should display "The selection can produce a max of 5 cases." + // AutoCaseRuleCommand autoCaseRuleCommand = new AutoCaseRuleCommand(elementView, selection, + // caseBoard.getCaseRule(), caseBoard, e); + + // NurikabeBoard caseyBoard = (NurikabeBoard) cases2.get(0); + // NurikabeBoard caseyBoard2 = (NurikabeBoard) cases2.get(1); + // NurikabeBoard caseyBoard3 = (NurikabeBoard) cases2.get(2); + // NurikabeBoard caseyBoard4 = (NurikabeBoard) cases2.get(3); + // NurikabeBoard caseyBoard5 = (NurikabeBoard) cases2.get(4); + // NurikabeBoard caseyBoard6 = (NurikabeBoard) cases2.get(5); + // NurikabeBoard caseyBoard7 = (NurikabeBoard) cases2.get(6); + // NurikabeBoard caseyBoard8 = (NurikabeBoard) cases2.get(7); + // + // NurikabeType boardy1Type = caseyBoard.getCell(5,5).getType(); + // NurikabeType boardy2Type = caseyBoard2.getCell(6,6).getType(); + // NurikabeType boardy3Type = caseyBoard.getCell(5,5).getType(); + // NurikabeType boardy4Type = caseyBoard2.getCell(6,6).getType(); + // NurikabeType boardy5Type = caseyBoard.getCell(5,5).getType(); + // NurikabeType boardy6Type = caseyBoard2.getCell(6,6).getType(); + // NurikabeType boardy7Type = caseyBoard.getCell(5,5).getType(); + // NurikabeType boardy8Type = caseyBoard2.getCell(6,6).getType(); + + } +} diff --git a/src/test/java/puzzles/shorttruthtable/ShortTruthTableImporterTest.java b/src/test/java/puzzles/shorttruthtable/ShortTruthTableImporterTest.java deleted file mode 100644 index 3054a99d9..000000000 --- a/src/test/java/puzzles/shorttruthtable/ShortTruthTableImporterTest.java +++ /dev/null @@ -1,10 +0,0 @@ -// package puzzles.shorttruthtable; - -// class ShortTruthTableImporterTest{ - -// @Test -// public void testImport(){ - -// } - -// } diff --git a/src/test/java/puzzles/shorttruthtable/ShortTruthTableStatementTest.java b/src/test/java/puzzles/shorttruthtable/ShortTruthTableStatementTest.java deleted file mode 100644 index 91a45933a..000000000 --- a/src/test/java/puzzles/shorttruthtable/ShortTruthTableStatementTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package puzzles.shorttruthtable; - -// import org.junit.Test; -// import static org.junit.Assert.assertEquals; - -// class ShortTruthTableStatementTest{ - -// @Test -// public void testCreateStatement(){ -// ShortTruthTableStatement statement = new ShortTruthTableStatement("a^b"); - -// assertEquals(statement.getLength(), 3); -// } - -// } diff --git a/src/test/java/puzzles/shorttruthtable/rules/AndContradictionRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/AndContradictionRuleTest.java new file mode 100644 index 000000000..618c03926 --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/AndContradictionRuleTest.java @@ -0,0 +1,132 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAnd; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class AndContradictionRuleTest { + + private static final ContradictionRuleAnd RULE = new ContradictionRuleAnd(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + /** + * Given a statement: A ^ B where ^ is true + * + *

Asserts that this is a valid application of the rule if and only if A or B are set to + * false. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void trueAndTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/AndContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + trueAndTestHelper(path + first + "T" + second); + } + } + } + + private void trueAndTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() == ShortTruthTableCellType.FALSE + || b.getType() == ShortTruthTableCellType.FALSE) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A ^ B where ^ is false + * + *

Asserts that this is a valid application of the rule if and only if A or B (or both) are + * set to true. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void falseAndTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/AndContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + falseAndTestHelper(path + first + "F" + second); + } + } + } + + private void falseAndTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() == ShortTruthTableCellType.TRUE + && b.getType() == ShortTruthTableCellType.TRUE) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A ^ B where ^ is unknown + * + *

Asserts that this is not a valid application of this rule. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void unknownAndTest() throws InvalidFileFormatException { + // Getting the files that have or set to unknown from And Introduction + String path = "puzzles/shorttruthtable/rules/AndIntroductionDirectRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + unknownAndTestHelper(path + first + "U" + second); + } + } + } + + private void unknownAndTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } +} diff --git a/src/test/java/puzzles/shorttruthtable/rules/AtomicContradictionRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/AtomicContradictionRuleTest.java new file mode 100644 index 000000000..a87035f42 --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/AtomicContradictionRuleTest.java @@ -0,0 +1,66 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAtomic; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class AtomicContradictionRuleTest { + + private static final ContradictionRuleAtomic RULE = new ContradictionRuleAtomic(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + /** + * Given two statements: A, A + * + *

Asserts that this is a valid application of the rule if and only if both A and B are not + * unknown and different. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void mismatchTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/AtomicContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + mismatchHelper(path + first + second); + } + } + } + + private void mismatchHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(0, 2); + + if (a.getType() != ShortTruthTableCellType.UNKNOWN + && b.getType() != ShortTruthTableCellType.UNKNOWN + && a.getType() != b.getType()) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } +} diff --git a/src/test/java/puzzles/shorttruthtable/rules/BiconditionalCaseRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/BiconditionalCaseRuleTest.java new file mode 100644 index 000000000..527cba652 --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/BiconditionalCaseRuleTest.java @@ -0,0 +1,191 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.caserule.CaseRuleBiconditional; +import edu.rpi.legup.save.InvalidFileFormatException; +import java.util.ArrayList; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class BiconditionalCaseRuleTest { + + private static final CaseRuleBiconditional RULE = new CaseRuleBiconditional(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + private void trueBiconditionalTest( + String fileName, int biconditionalX, int biconditionalY, int aX, int aY, int bX, int bY) + throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/shorttruthtable/rules/BiconditionalCaseRule/" + fileName, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell cell = board.getCell(biconditionalX, biconditionalY); + ArrayList cases = RULE.getCases(board, cell); + + // Make sure that the rule checks out + Assert.assertNull(RULE.checkRule(transition)); + + // Make sure there are two branches + Assert.assertEquals(2, cases.size()); + + ShortTruthTableBoard caseBoard1 = (ShortTruthTableBoard) cases.get(0); + ShortTruthTableCellType board1A = caseBoard1.getCell(aX, aY).getType(); + ShortTruthTableCellType board1B = caseBoard1.getCell(bX, bY).getType(); + + ShortTruthTableBoard caseBoard2 = (ShortTruthTableBoard) cases.get(1); + ShortTruthTableCellType board2A = caseBoard2.getCell(aX, aY).getType(); + ShortTruthTableCellType board2B = caseBoard2.getCell(bX, bY).getType(); + + // Assert that the corresponding cells for the different case rules do not + // match with each other + Assert.assertNotEquals(board1A, board2A); + Assert.assertNotEquals(board1B, board2B); + + // Assert that A and B are equal and either true or false in both branches + Assert.assertEquals(board1A, board1B); + Assert.assertTrue( + (board1A.equals(ShortTruthTableCellType.TRUE) + && board1B.equals(ShortTruthTableCellType.TRUE)) + || (board1A.equals(ShortTruthTableCellType.FALSE) + && board1B.equals(ShortTruthTableCellType.FALSE))); + + Assert.assertNotEquals(board1B, board2B); + Assert.assertTrue( + (board2A.equals(ShortTruthTableCellType.TRUE) + && board2B.equals(ShortTruthTableCellType.TRUE)) + || (board2A.equals(ShortTruthTableCellType.FALSE) + && board2B.equals(ShortTruthTableCellType.FALSE))); + + // Verify the board dimensions are unchanged + Assert.assertEquals(caseBoard1.getHeight(), caseBoard2.getHeight(), board.getHeight()); + Assert.assertEquals(caseBoard1.getWidth(), caseBoard2.getWidth(), board.getWidth()); + + // Verify that everywhere else on the board is unchanged + for (int i = 0; i < caseBoard1.getWidth(); i++) { + for (int j = 0; j < caseBoard1.getHeight(); j++) { + // Make sure not to check the two cells that should be different + if (!((i == aX && j == aY) || (i == bX && j == bY))) { + Assert.assertEquals( + caseBoard1.getCell(i, j).getType(), caseBoard2.getCell(i, j).getType()); + } + } + } + } + + /** + * Given a statement A -> B where ^ is true, tests this case rule by ensuring that two branches + * are created: one where A is false and one where B is true. + */ + @Test + public void SimpleStatement1TrueTest() throws InvalidFileFormatException { + trueBiconditionalTest("TrueBiconditional", 1, 0, 0, 0, 2, 0); + } + + /** + * Given a statement ~(A|B) -> (C^D) where the -> is true, tests this case rule by ensuring that + * two branches are created: one where ~ is false and one where ^ is true. + */ + @Test + public void ComplexStatement1TrueTest() throws InvalidFileFormatException { + trueBiconditionalTest("ComplexStatement1_True", 6, 0, 0, 0, 9, 0); + } + + private void falseBiconditionalTest( + String fileName, int biconditionalX, int biconditionalY, int aX, int aY, int bX, int bY) + throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/shorttruthtable/rules/BiconditionalCaseRule/" + fileName, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell cell = board.getCell(biconditionalX, biconditionalY); + ArrayList cases = RULE.getCases(board, cell); + + // Make sure that the rule checks out + Assert.assertNull(RULE.checkRule(transition)); + + // Make sure there are two branches + Assert.assertEquals(2, cases.size()); + + ShortTruthTableBoard caseBoard1 = (ShortTruthTableBoard) cases.get(0); + ShortTruthTableCellType board1A = caseBoard1.getCell(aX, aY).getType(); + ShortTruthTableCellType board1B = caseBoard1.getCell(bX, bY).getType(); + + ShortTruthTableBoard caseBoard2 = (ShortTruthTableBoard) cases.get(1); + ShortTruthTableCellType board2A = caseBoard2.getCell(aX, aY).getType(); + ShortTruthTableCellType board2B = caseBoard2.getCell(bX, bY).getType(); + + // Assert that the corresponding cells for the different case rules do not + // match with each other + Assert.assertNotEquals(board1A, board2A); + Assert.assertNotEquals(board1B, board2B); + + // Assert that A and B are not equal and are both either true or false in both branches + Assert.assertNotEquals(board1A, board1B); + Assert.assertTrue( + (board1A.equals(ShortTruthTableCellType.TRUE) + && board1B.equals(ShortTruthTableCellType.FALSE)) + || (board1A.equals(ShortTruthTableCellType.FALSE) + && board1B.equals(ShortTruthTableCellType.TRUE))); + + Assert.assertNotEquals(board2A, board2B); + Assert.assertTrue( + (board2A.equals(ShortTruthTableCellType.TRUE) + && board2B.equals(ShortTruthTableCellType.FALSE)) + || (board2A.equals(ShortTruthTableCellType.FALSE) + && board2B.equals(ShortTruthTableCellType.TRUE))); + + // Verify the board dimensions are unchanged + Assert.assertEquals(caseBoard1.getHeight(), caseBoard2.getHeight(), board.getHeight()); + Assert.assertEquals(caseBoard1.getWidth(), caseBoard2.getWidth(), board.getWidth()); + + // Verify that everywhere else on the board is unchanged + for (int i = 0; i < caseBoard1.getWidth(); i++) { + for (int j = 0; j < caseBoard1.getHeight(); j++) { + // Make sure not to check the two cells that should be different + if (!((i == aX && j == aY) || (i == bX && j == bY))) { + Assert.assertEquals( + caseBoard1.getCell(i, j).getType(), caseBoard2.getCell(i, j).getType()); + } + } + } + } + + /** + * Given a statement A -> B where -> is false, tests this case rule by ensuring that one branch + * is created where A is true and B is false. + */ + @Test + public void SimpleStatement1FalseTest() throws InvalidFileFormatException { + falseBiconditionalTest("FalseBiconditional", 1, 0, 0, 0, 2, 0); + } + + /** + * Given a statement ~(A|B) -> (C^D) where -> is true, tests this case rule by ensuring that one + * branch is created where ~ is true and ^ is false. + */ + @Test + public void ComplexStatement1FalseTest() throws InvalidFileFormatException { + falseBiconditionalTest("ComplexStatement1_False", 6, 0, 0, 0, 9, 0); + } +} diff --git a/src/test/java/puzzles/shorttruthtable/rules/BiconditionalContradictionRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/BiconditionalContradictionRuleTest.java new file mode 100644 index 000000000..af41a5b8c --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/BiconditionalContradictionRuleTest.java @@ -0,0 +1,134 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleBiconditional; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class BiconditionalContradictionRuleTest { + + private static final ContradictionRuleBiconditional RULE = new ContradictionRuleBiconditional(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + /** + * Given a statement: A <-> B where <-> is true + * + *

Asserts that this is a valid application of the rule if and only if A and B are not + * unknown and A does not equal B + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void trueBiconditionalTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/BiconditionalContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + trueBiconditionalTestHelper(path + first + "T" + second); + } + } + } + + private void trueBiconditionalTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() != ShortTruthTableCellType.UNKNOWN + && b.getType() != ShortTruthTableCellType.UNKNOWN + && a.getType() != b.getType()) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A <-> B where <-> is false + * + *

Asserts that this is a valid application of the rule if and only if A and B are not + * unknown and A equals B + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void falseConditionalTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/BiconditionalContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + falseBiconditionalTestHelper(path + first + "F" + second); + } + } + } + + private void falseBiconditionalTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() != ShortTruthTableCellType.UNKNOWN + && b.getType() != ShortTruthTableCellType.UNKNOWN + && a.getType() == b.getType()) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A <-> B where <-> is unknown + * + *

Asserts that this is not a valid application of this rule. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void unknownBiconditionalTest() throws InvalidFileFormatException { + // Getting the files that have or set to unknown from Biconditional Introduction + String path = "puzzles/shorttruthtable/rules/BiconditionalIntroductionDirectRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + unknownBiconditionalTestHelper(path + first + "U" + second); + } + } + } + + private void unknownBiconditionalTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } +} diff --git a/src/test/java/puzzles/shorttruthtable/rules/ConditionalCaseRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/ConditionalCaseRuleTest.java new file mode 100644 index 000000000..891fd975d --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/ConditionalCaseRuleTest.java @@ -0,0 +1,160 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.caserule.CaseRuleConditional; +import edu.rpi.legup.save.InvalidFileFormatException; +import java.util.ArrayList; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ConditionalCaseRuleTest { + + private static final CaseRuleConditional RULE = new CaseRuleConditional(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + private void trueConditionalTest( + String fileName, int conditionalX, int conditionalY, int aX, int aY, int bX, int bY) + throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/shorttruthtable/rules/ConditionalCaseRule/" + fileName, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell cell = board.getCell(conditionalX, conditionalY); + ArrayList cases = RULE.getCases(board, cell); + + // Make sure that the rule checks out + Assert.assertNull(RULE.checkRule(transition)); + + // Make sure there are two branches + Assert.assertEquals(2, cases.size()); + + ShortTruthTableBoard caseBoard1 = (ShortTruthTableBoard) cases.get(0); + ShortTruthTableCellType board1A = caseBoard1.getCell(aX, aY).getType(); + ShortTruthTableCellType board1B = caseBoard1.getCell(bX, bY).getType(); + + ShortTruthTableBoard caseBoard2 = (ShortTruthTableBoard) cases.get(1); + ShortTruthTableCellType board2A = caseBoard2.getCell(aX, aY).getType(); + ShortTruthTableCellType board2B = caseBoard2.getCell(bX, bY).getType(); + + // Assert that the corresponding cells for the different case rules do not + // match with each other + Assert.assertNotEquals(board1A, board2A); + Assert.assertNotEquals(board1B, board2B); + + // Assert that A is unknown in one board and false in the other + Assert.assertNotEquals(board1A, board2A); + Assert.assertTrue( + (board1A.equals(ShortTruthTableCellType.UNKNOWN) + && board2A.equals(ShortTruthTableCellType.FALSE)) + || (board1A.equals(ShortTruthTableCellType.FALSE) + && board2A.equals(ShortTruthTableCellType.UNKNOWN))); + + // Assert that B is unknown in one board and true in the other + Assert.assertNotEquals(board1B, board2B); + Assert.assertTrue( + (board1B.equals(ShortTruthTableCellType.UNKNOWN) + && board2B.equals(ShortTruthTableCellType.TRUE)) + || (board1B.equals(ShortTruthTableCellType.TRUE) + && board2B.equals(ShortTruthTableCellType.UNKNOWN))); + + // Verify the board dimensions are unchanged + Assert.assertEquals(caseBoard1.getHeight(), caseBoard2.getHeight(), board.getHeight()); + Assert.assertEquals(caseBoard1.getWidth(), caseBoard2.getWidth(), board.getWidth()); + + // Verify that everywhere else on the board is unchanged + for (int i = 0; i < caseBoard1.getWidth(); i++) { + for (int j = 0; j < caseBoard1.getHeight(); j++) { + // Make sure not to check the two cells that should be different + if (!((i == aX && j == aY) || (i == bX && j == bY))) { + Assert.assertEquals( + caseBoard1.getCell(i, j).getType(), caseBoard2.getCell(i, j).getType()); + } + } + } + } + + /** + * Given a statement A -> B where ^ is true, tests this case rule by ensuring that two branches + * are created: one where A is false and one where B is true. + */ + @Test + public void SimpleStatement1TrueTest() throws InvalidFileFormatException { + trueConditionalTest("TrueConditional", 1, 0, 0, 0, 2, 0); + } + + /** + * Given a statement ~(A|B) -> (C^D) where the -> is true, tests this case rule by ensuring that + * two branches are created: one where ~ is false and one where ^ is true. + */ + @Test + public void ComplexStatement1TrueTest() throws InvalidFileFormatException { + trueConditionalTest("ComplexStatement1_True", 6, 0, 0, 0, 9, 0); + } + + private void falseConditionalTest( + String fileName, int conditionalX, int conditionalY, int aX, int aY, int bX, int bY) + throws InvalidFileFormatException { + TestUtilities.importTestBoard( + "puzzles/shorttruthtable/rules/ConditionalCaseRule/" + fileName, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell cell = board.getCell(conditionalX, conditionalY); + ArrayList cases = RULE.getCases(board, cell); + + // Make sure that the rule checks out + Assert.assertNull(RULE.checkRule(transition)); + + // There should only be 1 branch + Assert.assertEquals(1, cases.size()); + + ShortTruthTableBoard caseBoard = (ShortTruthTableBoard) cases.get(0); + ShortTruthTableCellType caseBoardAType = caseBoard.getCell(aX, aY).getType(); + ShortTruthTableCellType caseBoardBType = caseBoard.getCell(bX, bY).getType(); + + // A should be true and B should be false + Assert.assertEquals(caseBoardAType, ShortTruthTableCellType.TRUE); + Assert.assertEquals(caseBoardBType, ShortTruthTableCellType.FALSE); + + // Verify the board dimensions are unchanged + Assert.assertEquals(caseBoard.getHeight(), caseBoard.getHeight(), board.getHeight()); + } + + /** + * Given a statement A -> B where -> is false, tests this case rule by ensuring that one branch + * is created where A is true and B is false. + */ + @Test + public void SimpleStatement1FalseTest() throws InvalidFileFormatException { + falseConditionalTest("FalseConditional", 1, 0, 0, 0, 2, 0); + } + + /** + * Given a statement ~(A|B) -> (C^D) where -> is true, tests this case rule by ensuring that one + * branch is created where ~ is true and ^ is false. + */ + @Test + public void ComplexStatement1FalseTest() throws InvalidFileFormatException { + falseConditionalTest("ComplexStatement1_False", 6, 0, 0, 0, 9, 0); + } +} diff --git a/src/test/java/puzzles/shorttruthtable/rules/ConditionalContradictionRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/ConditionalContradictionRuleTest.java new file mode 100644 index 000000000..cfbc98b67 --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/ConditionalContradictionRuleTest.java @@ -0,0 +1,132 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleConditional; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ConditionalContradictionRuleTest { + + private static final ContradictionRuleConditional RULE = new ContradictionRuleConditional(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + /** + * Given a statement: A -> B where -> is true + * + *

Asserts that this is a valid application of the rule if and only if both A is true and B + * is false + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void trueConditionalTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/ConditionalContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + trueConditionalTestHelper(path + first + "T" + second); + } + } + } + + private void trueConditionalTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() == ShortTruthTableCellType.TRUE + && b.getType() == ShortTruthTableCellType.FALSE) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A -> B where -> is false + * + *

Asserts that this is a valid application of the rule if and only if A is false or B is + * true + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void falseConditionalTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/ConditionalContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + falseConditionalTestHelper(path + first + "F" + second); + } + } + } + + private void falseConditionalTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() == ShortTruthTableCellType.FALSE + || b.getType() == ShortTruthTableCellType.TRUE) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A -> B where -> is unknown + * + *

Asserts that this is not a valid application of this rule. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void unknownConditionalTest() throws InvalidFileFormatException { + // Getting the files that have or set to unknown from Conditional Introduction + String path = "puzzles/shorttruthtable/rules/ConditionalIntroductionDirectRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + unknownConditionalTestHelper(path + first + "U" + second); + } + } + } + + private void unknownConditionalTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } +} diff --git a/src/test/java/puzzles/shorttruthtable/rules/NotContradictionRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/NotContradictionRuleTest.java new file mode 100644 index 000000000..b95612235 --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/NotContradictionRuleTest.java @@ -0,0 +1,67 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleNot; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class NotContradictionRuleTest { + + private static final ContradictionRuleNot RULE = new ContradictionRuleNot(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + /** + * Given a statement: ¬A + * + *

Asserts that this is a valid application of the rule if and only if A and B are both true + * or are both false. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void notContradictionTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/NotContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + notContradictionTestHelper(path + first + second); + } + } + } + + private void notContradictionTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell not = board.getCell(0, 0); + ShortTruthTableCell a = board.getCell(1, 0); + + if ((not.getType() == ShortTruthTableCellType.TRUE + && a.getType() == ShortTruthTableCellType.TRUE) + || (not.getType() == ShortTruthTableCellType.FALSE + && a.getType() == ShortTruthTableCellType.FALSE)) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } +} diff --git a/src/test/java/puzzles/shorttruthtable/rules/OrCaseRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/OrCaseRuleTest.java index 0bfa6fc6e..4c0fbe8c0 100644 --- a/src/test/java/puzzles/shorttruthtable/rules/OrCaseRuleTest.java +++ b/src/test/java/puzzles/shorttruthtable/rules/OrCaseRuleTest.java @@ -58,7 +58,7 @@ private void trueOrTest(String fileName, int andX, int andY, int aX, int aY, int Assert.assertNotEquals(board1B, board2B); // First assert the two cells are not equal, then verify that they are either - // unknown or false. + // unknown or true. Assert.assertNotEquals(board1A, board1B); Assert.assertTrue( board1A.equals(ShortTruthTableCellType.UNKNOWN) @@ -130,7 +130,7 @@ private void falseOrTest(String fileName, int andX, int andY, int aX, int aY, in ShortTruthTableCellType caseBoardAType = caseBoard.getCell(aX, aY).getType(); ShortTruthTableCellType caseBoardBType = caseBoard.getCell(bX, bY).getType(); - // Both cells should be true + // Both cells should be false Assert.assertEquals(caseBoardAType, ShortTruthTableCellType.FALSE); Assert.assertEquals(caseBoardBType, ShortTruthTableCellType.FALSE); Assert.assertEquals(caseBoardAType, caseBoardBType); diff --git a/src/test/java/puzzles/shorttruthtable/rules/OrContradictionRuleTest.java b/src/test/java/puzzles/shorttruthtable/rules/OrContradictionRuleTest.java new file mode 100644 index 000000000..d03328640 --- /dev/null +++ b/src/test/java/puzzles/shorttruthtable/rules/OrContradictionRuleTest.java @@ -0,0 +1,132 @@ +package puzzles.shorttruthtable.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTable; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell; +import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCellType; +import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleOr; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class OrContradictionRuleTest { + + private static final ContradictionRuleOr RULE = new ContradictionRuleOr(); + private static ShortTruthTable stt; + + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + stt = new ShortTruthTable(); + } + + /** + * Given a statement: A V B where V is true + * + *

Asserts that this is a valid application of the rule if and only if both A and B are set + * to false. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void trueOrTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/OrContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + trueOrTestHelper(path + first + "T" + second); + } + } + } + + private void trueOrTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() == ShortTruthTableCellType.FALSE + && b.getType() == ShortTruthTableCellType.FALSE) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A V B where V is false + * + *

Asserts that this is a valid application of the rule if and only if A or B is set to true + * or both A and B are set to true. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void falseOrTest() throws InvalidFileFormatException { + String path = "puzzles/shorttruthtable/rules/OrContradictionRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + falseOrTestHelper(path + first + "F" + second); + } + } + } + + private void falseOrTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard(); + ShortTruthTableCell a = board.getCell(0, 0); + ShortTruthTableCell b = board.getCell(2, 0); + + if (a.getType() == ShortTruthTableCellType.TRUE + || b.getType() == ShortTruthTableCellType.TRUE) { + Assert.assertNull(RULE.checkContradiction(transition.getBoard())); + } else { + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } + } + + /** + * Given a statement: A V B where V is unknown + * + *

Asserts that this is not a valid application of this rule. + * + * @param filePath The file path for test board setup. + * @throws InvalidFileFormatException + */ + @Test + public void unknownOrTest() throws InvalidFileFormatException { + // Getting the files that have or set to unknown from Or Introduction + String path = "puzzles/shorttruthtable/rules/OrIntroductionDirectRule/"; + String[] letters = {"T", "F", "U"}; + for (String first : letters) { + for (String second : letters) { + unknownOrTestHelper(path + first + "U" + second); + } + } + } + + private void unknownOrTestHelper(String filePath) throws InvalidFileFormatException { + TestUtilities.importTestBoard(filePath, stt); + TreeNode rootNode = stt.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + Assert.assertNotNull(RULE.checkContradiction(transition.getBoard())); + } +} diff --git a/src/test/resources/puzzles/lightup/rules/FinishWithEmptyDirectRule/FinishWithEmptyWithThree b/src/test/resources/puzzles/lightup/rules/FinishWithEmptyDirectRule/FinishWithEmptyWithThree index c5ad17cba..2e2712a50 100644 --- a/src/test/resources/puzzles/lightup/rules/FinishWithEmptyDirectRule/FinishWithEmptyWithThree +++ b/src/test/resources/puzzles/lightup/rules/FinishWithEmptyDirectRule/FinishWithEmptyWithThree @@ -3,9 +3,9 @@ - + diff --git a/src/test/resources/puzzles/nurikabe/rules/FinishRoomCaseRule/FinishRoomCaseRuleBase b/src/test/resources/puzzles/nurikabe/rules/FinishRoomCaseRule/FinishRoomCaseRuleBase new file mode 100644 index 000000000..c40870b96 --- /dev/null +++ b/src/test/resources/puzzles/nurikabe/rules/FinishRoomCaseRule/FinishRoomCaseRuleBase @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFF b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFF new file mode 100644 index 000000000..5285dbb86 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFT b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFT new file mode 100644 index 000000000..18d6030d9 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFU b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFU new file mode 100644 index 000000000..39b9e9811 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTF b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTF new file mode 100644 index 000000000..9df198c5f --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTT b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTT new file mode 100644 index 000000000..0c2feabe7 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTU b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTU new file mode 100644 index 000000000..d024cb841 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/FTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFF b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFF new file mode 100644 index 000000000..8234ebd2a --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFT b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFT new file mode 100644 index 000000000..4a6b0f1d7 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFU b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFU new file mode 100644 index 000000000..b2bb6e1a5 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTF b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTF new file mode 100644 index 000000000..9e53ac8e3 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTT b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTT new file mode 100644 index 000000000..837730943 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTU b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTU new file mode 100644 index 000000000..893f7d3ec --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/TTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFF b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFF new file mode 100644 index 000000000..6d4f44071 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFT b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFT new file mode 100644 index 000000000..7fcda3fba --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFU b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFU new file mode 100644 index 000000000..5285dbb86 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UFU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTF b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTF new file mode 100644 index 000000000..d11a314b8 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTT b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTT new file mode 100644 index 000000000..1772e1986 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTU b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTU new file mode 100644 index 000000000..9df198c5f --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AndContradictionRule/UTU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FF b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FF new file mode 100644 index 000000000..47ede6499 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FT b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FT new file mode 100644 index 000000000..56192a97b --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FU b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FU new file mode 100644 index 000000000..9e25868fc --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/FU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TF b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TF new file mode 100644 index 000000000..326988fbb --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TT b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TT new file mode 100644 index 000000000..0b8b9b690 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TU b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TU new file mode 100644 index 000000000..4ee98e3d4 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/TU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UF b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UF new file mode 100644 index 000000000..03432df5f --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UT b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UT new file mode 100644 index 000000000..a69e019a2 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UU b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UU new file mode 100644 index 000000000..7d1f0bae6 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/AtomicContradictionRule/UU @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/ComplexStatement1_False b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/ComplexStatement1_False new file mode 100644 index 000000000..8f31d9771 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/ComplexStatement1_False @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/ComplexStatement1_True b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/ComplexStatement1_True new file mode 100644 index 000000000..f0bb0d508 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/ComplexStatement1_True @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/FalseBiconditional b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/FalseBiconditional new file mode 100644 index 000000000..5ea1c8a63 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/FalseBiconditional @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/TrueBiconditional b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/TrueBiconditional new file mode 100644 index 000000000..cbf64468f --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/TrueBiconditional @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/UnknownConditional b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/UnknownConditional new file mode 100644 index 000000000..82cdeb3ea --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalCaseRule/UnknownConditional @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFF b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFF new file mode 100644 index 000000000..b1c975982 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFT b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFT new file mode 100644 index 000000000..9aaa26431 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFU b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFU new file mode 100644 index 000000000..150134e46 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTF b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTF new file mode 100644 index 000000000..e1cecaeb7 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTT b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTT new file mode 100644 index 000000000..370cefc0a --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTU b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTU new file mode 100644 index 000000000..4ac904290 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/FTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFF b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFF new file mode 100644 index 000000000..48e1fa36b --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFT b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFT new file mode 100644 index 000000000..a260489cc --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFU b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFU new file mode 100644 index 000000000..08a999c1a --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTF b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTF new file mode 100644 index 000000000..c6764d0fb --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTT b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTT new file mode 100644 index 000000000..7ce20257b --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTU b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTU new file mode 100644 index 000000000..b440c157a --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/TTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFF b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFF new file mode 100644 index 000000000..865d9b59b --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFT b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFT new file mode 100644 index 000000000..31f372a95 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFU b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFU new file mode 100644 index 000000000..b1c975982 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UFU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTF b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTF new file mode 100644 index 000000000..e1e7eeafc --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTT b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTT new file mode 100644 index 000000000..15ed9b08f --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTU b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTU new file mode 100644 index 000000000..e1cecaeb7 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/BiconditionalContradictionRule/UTU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/ComplexStatement1_False b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/ComplexStatement1_False new file mode 100644 index 000000000..f8be5f275 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/ComplexStatement1_False @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/ComplexStatement1_True b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/ComplexStatement1_True new file mode 100644 index 000000000..d919b7214 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/ComplexStatement1_True @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/FalseConditional b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/FalseConditional new file mode 100644 index 000000000..2da458f51 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/FalseConditional @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/TrueConditional b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/TrueConditional new file mode 100644 index 000000000..829861f75 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/TrueConditional @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/UnknownConditional b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/UnknownConditional new file mode 100644 index 000000000..deb93776d --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalCaseRule/UnknownConditional @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFF b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFF new file mode 100644 index 000000000..479b8172d --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFT b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFT new file mode 100644 index 000000000..4c328f840 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFU b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFU new file mode 100644 index 000000000..2a5220f46 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTF b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTF new file mode 100644 index 000000000..d28a4b9f9 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTT b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTT new file mode 100644 index 000000000..aa0c242b3 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTU b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTU new file mode 100644 index 000000000..b9867188f --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/FTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFF b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFF new file mode 100644 index 000000000..ad3329472 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFT b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFT new file mode 100644 index 000000000..92eaf7cb3 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFU b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFU new file mode 100644 index 000000000..0ea50831a --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTF b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTF new file mode 100644 index 000000000..d0e4ec7bb --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTT b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTT new file mode 100644 index 000000000..e2f1a7102 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTU b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTU new file mode 100644 index 000000000..0a38381b1 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/TTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFF b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFF new file mode 100644 index 000000000..78ff4e0f0 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFT b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFT new file mode 100644 index 000000000..9ac9c39fa --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFU b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFU new file mode 100644 index 000000000..479b8172d --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UFU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTF b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTF new file mode 100644 index 000000000..cc05da528 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTT b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTT new file mode 100644 index 000000000..0559dcf83 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTU b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTU new file mode 100644 index 000000000..d28a4b9f9 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/ConditionalContradictionRule/UTU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FF b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FF new file mode 100644 index 000000000..56b5cd97e --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FT b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FT new file mode 100644 index 000000000..5091d620c --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FU b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FU new file mode 100644 index 000000000..ae65d166d --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/FU @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TF b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TF new file mode 100644 index 000000000..cf510f0c3 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TT b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TT new file mode 100644 index 000000000..7bcb69b15 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TU b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TU new file mode 100644 index 000000000..a33ef3016 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/TU @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UF b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UF new file mode 100644 index 000000000..96bc1fb52 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UF @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UT b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UT new file mode 100644 index 000000000..b87293cdc --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UT @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UU b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UU new file mode 100644 index 000000000..78bd1d67e --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/NotContradictionRule/UU @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFF b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFF new file mode 100644 index 000000000..32c62f59e --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFT b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFT new file mode 100644 index 000000000..96e3122bf --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFU b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFU new file mode 100644 index 000000000..b9bb63a6b --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTF b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTF new file mode 100644 index 000000000..062c5d3e4 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTT b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTT new file mode 100644 index 000000000..4fbb5922a --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTU b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTU new file mode 100644 index 000000000..1767546df --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/FTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFF b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFF new file mode 100644 index 000000000..3e50d3b54 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFT b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFT new file mode 100644 index 000000000..69cbef4db --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFU b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFU new file mode 100644 index 000000000..018064192 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TFU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTF b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTF new file mode 100644 index 000000000..8247a1cfa --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTF @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTT b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTT new file mode 100644 index 000000000..4446c1e34 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTT @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTU b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTU new file mode 100644 index 000000000..c662ec79b --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/TTU @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFF b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFF new file mode 100644 index 000000000..dae9e4311 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFT b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFT new file mode 100644 index 000000000..1c68eb53b --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFU b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFU new file mode 100644 index 000000000..32c62f59e --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UFU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTF b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTF new file mode 100644 index 000000000..67169da0c --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTF @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTT b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTT new file mode 100644 index 000000000..c761569c5 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTT @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTU b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTU new file mode 100644 index 000000000..062c5d3e4 --- /dev/null +++ b/src/test/resources/puzzles/shorttruthtable/rules/OrContradictionRule/UTU @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +