I am trying to learn to speak out large numbers in Japanese quickly. For this, I’m thinking about creating many cards with numbers in the front, then using a text-to-speech plugin to get a voice for the back side.
I know how to do the second step, but I don’t yet know how to do the first one.
Ideally, I am looking for a way to create 100 cards with random numbers between 1’000 and 1’000’000 on the front. But what would also help me would be a way to create a sequence of integers from, say, 1000 to 1100.
Is there a way to do that - ideally without an extra plugin?
You could use programming or scripting languages. The code would be very similar to something like this:
for(i=0; i<=100; i++){
console.log(i)
}
You could use something like Math.random() to generate a random set of numbers.
You then can write the output to a .csv file or simply copy and paste. In my example above I used javascript, but any programming / scripting language will be very similar to this. Keep in mind though that writing to a file with js might require node.js or similar (at least I don’t know how to do it with plain js).
Adding to @Anon_0000’s reply, you could use a very basic python file to create this format you want. Here’s the code.
import csv, random
f = open("(your path of the csv file)", "wt+", newline='')
csvw = csv.writer(f)
for i in range(100):
csvw.writerow([random.randint(1000,1000000)])
f.close()
This will generate a file on your device with 100 numbers between 1000 and 1000000. When importing, you can select the notetype and then accordingly the field to which these map. Once you add these, if you have some other fields which all have the same value, either you can change the [random.randint(1000,1000000)] to [random.randint(1000,1000000),"(that value here)"] (or more if necessary) OR you can select the cards you added and using find and replace, you can add the text (once imported).
The path to the file is a little more complicated, so refer to this to understand what to do.
Edit: Edited the code, was a little rusty so i made two minor mistakes. Try it with the newer one incase you have tried with the older one and it failed. If you are a beginner in Python, please do tell me so that I can guide you on what to do (or you could use an AI chatbot of your choice).