Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 911 Bytes

File metadata and controls

26 lines (16 loc) · 911 Bytes

pong.bt

A small command-line pong game implemented using bpftrace.

Inspired by bpftrace tetris

Instructions

Requires bpftrace 0.11.0 or newer.

Clone the repository, configure bpftrace on your system, and run using:

./run.sh

If all goes well, you should be able to see the game after waiting few seconds for the code to compile.

You can also customize the width, height, and computer difficulty using positional parameters:

./run.sh 41 12 70

Here the difficulty is measured as the percentage of times the computer's paddle correctly moves towards the ball. It defaults to 70% (i.e. the computer makes a mistake during 30% of movements), and you should increase this if you want higher difficulty.