I’m writing a program to pick a Psalm from the Bible at random and display it.
So for example, if the random number is 23, it will pick Psalm 23 and display Psalm 23.
Each time a Psalm is picked the Psalm’s number will be recorded in a file called “ChaptersChosen.txt”. This will allow statistics such as how many times each Psalm has been picked, and which Psalms have not been picked yet.
I have the book of Psalms in a text file formatted like:
1:1 Blessed is the man that walketh not in the counsel of the ungodly, nor standeth in the way of sinners, nor sitteth in the seat of the scornful.
1:2 But his delight is in the law of the LORD; and in his law doth he meditate day and night …
150:6 Let every thing that hath breath praise the LORD. Praise ye the LORD.
I’ve also got it in a dictionary format like:
{“1:1”: “Blessed is the man that walketh not in the counsel of the ungodly, nor standeth in the way of sinners, nor sitteth in the seat of the scornful.”, “1:2”: “But his delight is in the law of the LORD; and in his law doth he meditate day and night.”, …}
and I have considered a dictionary of dictionaries like:
{“1”: {“1:1”: “Blessed is the man that walketh not in the counsel of the ungodly, nor standeth in the way of sinners, nor sitteth in the seat of the scornful.”, “1:2”: “But his delight is in the law of the LORD; and in his law doth he meditate day and night.”, “1:3”: “And he shall be like a tree planted by the rivers of water, that bringeth forth his fruit in his season; his leaf also shall not wither; and whatsoever he doeth shall prosper.”, “1:4”: “The ungodly are not so: but are like the chaff which the wind driveth away.”, “1:5”: “Therefore the ungodly shall not stand in the judgment, nor sinners in the congregation of the righteous.”, “1:6”: “For the LORD knoweth the way of the righteous: but the way of the ungodly shall perish.”}, … }
My Question: What data structure would you recommend and why?
I’ve tried using all 3 and I wonder if I am going about it in the best way.