Code Monkey home page Code Monkey logo

linux_quiz_program's Introduction

Linux_Quiz_Program

리눅스 쉘 스크립트 문법에 관련된 문제들을 사용자가 맞추는 프로그램입니다.
리눅스 환경에서 작동하며, 터미널 간의 대전 방식이 적용되었습니다.

설치 및 컴파일 방법

  1. source 디렉토리를 다운받습니다.
  2. 아래 명령어를 통해 컴파일을 진행하여 실행파일 2개를 생성합니다.
g++ Exam.cpp UserData.cpp UI.cpp Client.cpp -o client
g++ Exam.cpp UserData.cpp Server.cpp -o server

실행 방법

  1. 사용할 터미널을 띄웁니다.

    • server 실행 터미널
    • 프로그램 실행 터미널(kill 명령어 사용)
    • client 실행 터미널(최대 5개의 터미널 지원)

  2. server를 실행합니다.

./server



  1. client를 실행하여 닉네임을 입력합니다.
    (최대 5개의 터미널을 지원하나 예시에서는 2개의 터미널을 사용합니다.)
./client



  1. kill 명령어로 프로그램을 실행합니다.
kill -SIGUSR1 [Server pid]

  • 클라이언트 변경 화면


  1. client에 문제의 답을 입력합니다. 각 client에서 맞춘 정답의 갯수를 하단에 표시해줍니다.
    총 27문항이 준비되어있으며, 모든 문제가 끝났을 경우 server는 자동 종료합니다.
    server에서 문제, 정답을 확인할 수 있습니다.


  2. 종료 시 client, server의 터미널에 Ctrl + C를 입력합니다.



  • Q. server에서 Wait Client가 무한 출력되는데 어떻게 해야 하나요?
    프로그램의 비정상 시작/종료(ex - server가 아닌 client를 먼저 실행시켰을 경우)에 의해 발생하는 오류입니다.
    ipcs 명령어로 이미 생성되어 있는 Message Queue와 Shared Memory를 확인한 후 ipcrm으로 제거한 후 실행하면 정상 작동됩니다.
ipcs	// IPC 자원 정보 출력
ipcrm -q [생성된 mspid]
ipcrm -m [생성된 shmid]

linux_quiz_program's People

Contributors

twilight-daisy avatar yesenin2020 avatar limlight94 avatar pearlrabbit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.