Place a redstone repeater facing away from the block with the redstone torch, and set it to its maximum delay (right-click it three times).
Place another solid block two blocks away from the repeater.
Place a second redstone repeater facing the new block, also set to its maximum delay.
Place redstone dust connecting the lever to the first repeater, and from the first repeater to the second repeater.
Place a slab on the ground next to the last block, creating a half-block space.
Place a water source block on the ground next to the slab.
Place TNT on top of the slab.
Connect the second repeater to the TNT using redstone dust.
Your basic TNT cannon is now complete. To use it, place as much TNT as you want on the slab, and then flip the lever to activate the cannon. The TNT will be launched in the direction the cannon is facing.
You can experiment with the delay settings on the repeaters and the amount of TNT used to adjust the cannon's range and power. Remember to be cautious when using TNT cannons, as they can cause significant damage to the surrounding area.