"And it came to pass, when Moses held up his hand, etc." (Exodus 17:11). What was the end of the matter? "And Joshua weakened (wa-yachalosh), etc." (Exodus 17:13). Rabbi Berekhyah the Priest said: He cast lots over them. A lot is called by four names: goral, pur, chevel, and cholesh.
Why Joshua Cast Lots to Defeat Amalek in the Wilderness
Midrash Tanchuma Buber, Yitro 4:4
והיה כאשר ירים משה וגו' (שם שם יא), מה היה הסוף, ויחלוש יהושע וגו' (שם שם יג), ר' ברכיה הכהן אמר הפיל עליהם גורלות, ארבעה שמות נקרא, גורל פור חבל חולש.