Skip to content Navigation Menu Toggle navigation Sign in Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests... Search Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Saved searches Use saved searches to filter your results more quickly Name Query To see all available qualifiers, see our documentation. Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} coderSuren / MemoryGrid Public Notifications You must be signed in to change notification settings Fork 0 Star 0 Code Issues 0 Pull requests 0 Actions Projects Security and quality 0 Insights Additional navigation options Code Issues Pull requests Actions Projects Security and quality Insights FilesExpand file tree mainBreadcrumbsMemoryGrid/Settings.javaCopy pathBlameMore file actionsBlameMore file actions Latest commit HistoryHistoryHistory221 lines (181 loc) · 3.92 KB mainBreadcrumbsMemoryGrid/Settings.javaCopy pathTopFile metadata and controlsCodeBlame221 lines (181 loc) · 3.92 KBRawCopy raw fileDownload raw fileOpen symbols panelEdit and raw actions123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221package MemoryGrid; import java.util.Scanner;import java.io.*; public class Settings { Scanner scan= new Scanner(System.in); public String description="This module is used to chnage the settings of the game"; public void changepassword(User u) throws IOException { Authentication auth= new Authentication(); String pass1; String pass2; System.out.println("Enter new pasword"); pass1=scan.nextLine(); System.out.println("retype new password"); pass2=scan.nextLine(); if (pass1.equals(pass2)) { auth.validate_password(pass1); if (auth.result!=-1) { System.out.println("password already taken"); return; } else { auth.validate_password(u.password); DB_Accessor.setpassword(auth.result+1, pass1); return; } } else { System.out.println("passwords does not match"); } System.out.println("here"); return; } public void changediff() { String difficulty; System.out.println("Enter 1 for easy"); System.out.println("Enter 2 for moderate"); System.out.println("Enter 3 for hard"); difficulty=scan.nextLine(); boolean proceed=true; switch(difficulty) { case "1": Grid.cd=240; if (GameSystem.theme_no==0) { GameSystem.theme="./src/MemoryGrid/Image_links/house_easy.txt"; } else { GameSystem.theme="./src/MemoryGrid/Image_links/emoji_easy.txt"; } break; case "2": Grid.cd=160; if (GameSystem.theme_no==0) { GameSystem.theme="./src/MemoryGrid/Image_links/house_medium.txt"; } else { GameSystem.theme="./src/MemoryGrid/Image_links/emoji_medium.txt"; } break; case "3": Grid.cd=120; if (GameSystem.theme_no==0) { GameSystem.theme="./src/MemoryGrid/Image_links/house_hard.txt"; } else { GameSystem.theme="./src/MemoryGrid/Image_links/emoji_hard.txt"; } break; default: System.out.println("Invalid input"); proceed=false; break; } if (proceed) { changemode(); } } public void changemode() { String mode; System.out.println("Enter c for cranky mode"); System.out.println("otherwise its in normal mode"); mode=scan.nextLine(); if (mode.equals("c")) { Grid.mode=1; } else { Grid.mode=0; } } public void changetheme() { String choice; System.out.println("Select any one of the folowing themes"); System.out.println("Enter e for emoji theme"); System.out.println("otherwise its home(default) theme"); choice=scan.nextLine(); if (choice.equals("e")) { GameSystem.theme_no=1; if (Grid.cd==240) { GameSystem.theme="./src/MemoryGrid/Image_links/emoji_easy.txt"; } else if (Grid.cd==160) { GameSystem.theme="./src/MemoryGrid/Image_links/emoji_medium.txt"; } else { GameSystem.theme="./src/MemoryGrid/Image_links/emoji_hard.txt"; } } else { GameSystem.theme_no=0; if (Grid.cd==240) { GameSystem.theme="./src/MemoryGrid/Image_links/house_easy.txt"; } else if (Grid.cd==160) { GameSystem.theme="./src/MemoryGrid/Image_links/house_medium.txt"; } else { GameSystem.theme="./src/MemoryGrid/Image_links/house_hard.txt"; } } } public void main(User u) throws IOException { String choice; while (true) { choice=" "; System.out.println("Press 1 to change difficulty and mode"); System.out.println("Press 2 to change theme"); System.out.println("Press 3 to change password"); System.out.println("Press 4 to return to main menu"); choice =scan.nextLine(); if (choice.equals("1")) { changediff(); } else if (choice.equals("2")) { changetheme(); } else if (choice.equals("3")) { changepassword(u); } else if (choice.equals("4")) { System.out.println("Retuning to main menu..."); break; } else { System.out.println("Invalid input.try again"); } } return; } } You can’t perform that action at this time.