Currently, there are many ongoing researches that are targeted at making robots more human-like. One of the tasks that can be done by humans easily but is difficult to be done by robots is writing. In this paper, we are presenting a flexible algorithm that can allow a robot to write. This algorithm is based on character segmentation, where the main idea is to store character information as segments and the segment information can then be used by the robot to write. We have also developed a sample application using the proposed algorithm to allow a Mitsubishi RV-2AJ robotic arm to write English characters and numbers. Through our experiment, it has been proven that the algorithm developed is able to allow the robotic arm to write.