PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Basic Spelling Game With Bash & Aspell On Linux Mint Example

Go down

Basic Spelling Game With Bash & Aspell On Linux Mint Example Empty Basic Spelling Game With Bash & Aspell On Linux Mint Example

Post by jamied_uk 9th June 2018, 21:34





Code:
#!/bin/bash
#
clear
echo "Welcome to the Spelling Game"
aspell check file.txt
# now compare the md5 sum of file with compare file aka file.txt.bak answer file made on 1st use with new players to show if level complete!
#
# now
# Show Resaults!
#
echo ""
#
diff -q file.txt afile.txt 1>/dev/null
if [[ $? == "0" ]]
then
    echo "Correct You Passed!"
    # cleanup here!
    cp file.txt.bak file.txt
else
    echo "You Failed, Try Again!"
    # cleanup here!
    cp file.txt.bak file.txt
fi
#
# Another way would be to use md5sum to check size and that way you don’t have an answer file where cheating could take place
#

Level 2

jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum