The idea is to evolve step by step trough small time intervals according to the dynamic equation that governs of the system. The fast superposition of the small updated steps will create the illusion of movemement. Below is the full code of the simulation.

As now the $\Delta t$ will be very small, we need to keep only terms until order $\Delta t$ and safely neglect terms of order $\Delta t^2$. Moreover, we can use directly the Principle of momentum \begin{equation}\mathbf{F}\Delta t=\Delta \mathbf{p}\\,,\end{equation} to obtain directly the velocity from the force: \begin{equation}\mathbf{v}=\mathbf{v}_0+\mathbf{F}/m\\,.\end{equation} In this way the acceleration does not appear explicitly in the dynamic equations (It is equivalent to assume the the speed is constant along the small paths associated to each $\Delta t$)

Finally, we can include the friction force proportional to the friction coefficient $\mu$, and recover the frictionless case just by setting $\mu=0$