Ve 280 Lab 1: Ex0. A Fun Bash Game Bashcrawl (Not Mandatory)
Ve 280 Lab 1: Ex0. A Fun Bash Game Bashcrawl (Not Mandatory)
The game is attached in the files. See /bashcrawl . It has its README.It will be uploaded on Gitea
soon. Have fun.
Kyon is thinking of moving his favourite Mikuru's photos from SOS Quantum Library sql/ to his
own webserver webserver/ without being noticed.
"If Haruhi knows this, Haruhi will destory the world. We have to avoid this".
Yuki suggests Kyon to use command lines. So Kyon decides to implement a shell script to
automate command line tasks. He may need these tasks:
Create: create the working directory of the database and webserver, and initialize the
database;
Dump: dump the data in the database into the webserver;
List: list all the files stored in the webserver;
Display: display the data in the webserver;
Destroy: remove the working directory of database and webserver.
He has already implemented the skeleton of ex1.sh , but now he . There are 5 of such lines in the
script that are marked as TODO comments:
Please help him finish this script by replacing the TODO s with a Linux command line you learned
from lecture.
1 chmod +x ./ex1.sh
Then, you can test the script by running the following commands and observe the results.
1 ./ex1.sh create
2 ./ex1.sh dump
3 ./ex1.sh list
4 ./ex1.sh display
5 ./ex1.sh destroy
Miyamori Aoi is designing the wbsite for Musani Animation. When designing the register page, she
plans to Write a function that checks whether the password that the user type in meets all the
requirements below (or say it is valid):
The function takes a password (an array of chars) as input, returns true if the password is valid
and returns false if not.
Miyamori is busy with their new animation. Please help her implement the function.
Note: In fact, when writing a web page, we use Regular Expression to validate whether a
password meets our requirement. We do not use C++ but we use JavaScript for web
programming. For those interested, you can Google it yourself.
Example
Example input:
1 kibo~no~hana~~1
Example output:
1 1
Description
Here our topic is about the principle behind image processing software, like how to flip an image
horizontally and invert it.
Like
Will result in
Of course this image will be too complicated for us to handle here. Let's simplify the problem.
To flip an image horizontally means that each row of the image is reversed.
Input
The first line contains a number n , which is the size of the matrix image .
The following lines represents the matrix, which only contains 0 or 1 . Each row separated by a
\n and each column separated by space.
Output
The flipped and inverted matrix
Example
Example input:
1 3
2 1 1 0
3 1 0 1
4 0 0 1
Example output:
1 1 0 0
2 0 1 0
3 0 1 1
Explantion:
1 0 1 1
2 1 0 1
3 1 0 0
Then invert it
1 1 0 0
2 0 1 0
3 0 1 1