Bulls and Cows Game built based on Laravel 5, as a competition for the students enrolling course "Foundations of Computer Science" in the University of Adelaide.
Live site: http://159.203.247.157/
Live test account: a1203212
sudo apt-get install sqlite3
sudo apt-get install php5
sudo apt-get install php5-sqlite
sudo apt-get install git
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer global require "laravel/installer=~1.1"
git clone https://github.com/cqqlin/fcsc
cd fcsc
composer install
vi database/seeds/StudentTableSeeder.php
Paste the following php script to the editor, and modify the data as needed:
<?php
use Illuminate\Database\Seeder;
class StudentTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$students = [
["id" => "id_001", "firstName" => "Louie", "lastName" => "Qin"],
["id" => "id_002", "firstName" => "Keith", "lastName" => "Lin"],
["id" => "id_003", "firstName" => "Minming", "lastName" => "Qian"],
];
foreach ($students as $student) {
DB::table('students')->insert([
'id' => $student['id'],
'firstName' => $student['firstName'],
'lastName' => $student['lastName'],
'lastPlayed' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', '1970-01-01 00:00:00'),
'highestMark' => 0,
'recordDate' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', '1970-01-01 00:00:00')
]);
}
}
}
vi .env
Paste the following text to the editor, and modify the configiration as needed (For example, to disable the debug mode, which will show the secret number as you guess, please change to "APP_DEBUG=false". Apart from that, you also need to change END_DATE according to your needs.):
APP_ENV=local
APP_DEBUG=true
APP_KEY=ffvR5FcYprwdZaHsMc4RMQASgzDLSBfF
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
END_DATE=2018-10-18 13:30:00
DEDUCT_ROUND_POINT_INTERVAL=45
touch storage/database.sqlite
composer dump-autoload
php artisan migrate:refresh --seed
php artisan key:generate
To test on a local machine:
php -S localhost:8888 -t public
Or to run the service on a server and open to public:
php -S your.ip.address:port -t public &
Or something like:
php -S 129.127.10.84:80 -t public &
or
or
You can then login and start a game using a user id (id_001, id_002, id_003 in the case of this instruction) according to your StudentTableSeeder.php file.