When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7. 1 times 4 equals 4 2 times 4 equals 8 3 times 4 equals 12 4 times 4 equals 16 5 times 4 equals 20 6 times 4 equals 24 7 times 4 equals 28 8 times 4 equals 32 9 times 4 equals 36 10 times 4 equals 40 11 times 4 equals 44 12 times 4 equals 48
The -7 times table.
When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7. 1 times -7 equals -7 2 times -7 equals -14 3 times -7 equals -21 4 times -7 equals -28 5 times -7 equals -35 6 times -7 equals -42 7 times -7 equals -49 8 times -7 equals -56 9 times -7 equals -63 10 times -7 equals -70 11 times -7 equals -77 12 times -7 equals -84
The -7 times table.
When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7. 1 times -7 equals -7 2 times -7 equals -14 3 times -7 equals -21 4 times -7 equals -28 5 times -7 equals -35 6 times -7 equals -42 7 times -7 equals -49 8 times -7 equals -56 9 times -7 equals -63 10 times -7 equals -70 11 times -7 equals -77 12 times -7 equals -84
The -7 times table.
When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7. 1 times -7 equals -7 2 times -7 equals -14 3 times -7 equals -21 4 times -7 equals -28 5 times -7 equals -35 6 times -7 equals -42 7 times -7 equals -49 8 times -7 equals -56 9 times -7 equals -63 10 times -7 equals -70 11 times -7 equals -77 12 times -7 equals -84
The -9 times table.
When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7. 1 times -9 equals -9 2 times -9 equals -18 3 times -9 equals -27 4 times -9 equals -36 5 times -9 equals -45 6 times -9 equals -54 7 times -9 equals -63 8 times -9 equals -72 9 times -9 equals -81 10 times -9 equals -90 11 times -9 equals -99 12 times -9 equals -108
Q1. What does %w+ match in a Lua pattern?
A1. As it's written in the documentation, it represents all ASCII alphanumeric characters. In this case, they'll correspond to the month.
Q2. What does %d+ match in a Lua pattern?
A2. As it's written in the documentation, it represents all digits. In this case, they'll correspond to the day or year.
Year = 2018 Day = 31 Month = October, that is the tenth month.
Yes, I can figure out how does it works. The input is passed to the function and then saved to the variable dmy. After that, there're declared three variables that will come from casting dmy into three pieces, thanks to the method string.match that, as it's written in the documentation, it compares the first parameter, in this case, dmy, with a given parameter as a second attribute, in this case, numbers characters numbers, that are saved corresponding to the variables d, m and y. Finally, the variables are concatenated with some text and returned.
In order to get the values of the day, month and year in this format, we should modify the line that saves each value in the variable, searching in the first place instead of the day the month, in second place the day and lastly the year. Note that as also a comma (,) is introduced, we also should cast it. I made a function p.unpackUS that applies this changes. I also implemented some lines to get the ordinal position of the month. In the above example, the given value was "mdydate=October 31, 2018"
Year = 2018 Day = 31 Month = October, that is the tenth month.
In the below example, we can see how the data is returned from the Wikimedia database. A + precedes the date (obviously a time-data type). After it, the year, a -, the month, another -, the day, and without any separation, a T that indicates the start of the specific time in the form hh:mm:ss, which null value is 00:00:00, and finally, also without separation, a Z.
+1952-03-11T00:00:00Z
The input is qid=Q42 and prop=P569.
The year is 1952, the month is 03 and the day is 11. This date in an ISO-style is 1952-03-11.
The input is qid=Q151973 and prop=P569.
The year is 1925, the month is 11 and the day is 10. This date in an ISO-style is 1925-11-10.
The input is qid=Q34851 and prop=P570.
The year is 2011, the month is 03 and the day is 23. This date in an ISO-style is 2011-03-23.