Advertisement
YourMain12

Basic Anticheat (FORTRAN)

Jan 7th, 2023
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program anticheat
  2.   implicit none
  3.  
  4.   character(len=20) :: cheats(3) = ['cheat1', 'cheat2', 'cheat3']
  5.   character(len=20) :: input
  6.   logical :: isCheating
  7.  
  8.   ! Prompt the user for input
  9.   write(*,'(A)') 'Enter a command: '
  10.   read(*,'(A)') input
  11.  
  12.   ! Check if the user is cheating
  13.   isCheating = .false.
  14.   do i = 1, 3
  15.     if (index(input, cheats(i)).ne.0) then
  16.       isCheating = .true.
  17.       exit
  18.     end if
  19.   end do
  20.  
  21.   ! If the user is cheating, display a message and exit the program
  22.   if (isCheating) then
  23.     write(*,'(A)') 'Cheating is not allowed!'
  24.     stop
  25.   end if
  26.  
  27.   ! If the user is not cheating, continue with the program
  28.   write(*,'(A)') 'Valid input'
  29. end program anticheat
  30.  
Tags: Fortran
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement