1. The file "hard_rods.inp" collect the input data (the distance between walls, the chemical potential, and the mixing parameter of the fixed point algorithm) necessary to run the code. 2. The file "hard_rods.f" is the main commented fortran code to calculate the density profile of one-dimensional hard rods confined between two hard walls. 3. The file "hard_rods.dat" collect the output data (such as the mean density inside the slit, and the free energy and pressure of the confined fluid). 4. The file "profile.dat" collect the density profile (rho(x)) and the local packing fraction (eta(x)).