aboutsummaryrefslogtreecommitdiff
path: root/challenge-142/eric-cheung
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2021-12-06 20:58:06 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2021-12-06 20:58:06 +0000
commit896c415abc215829ef87d7fde92ab5c8d4ae536f (patch)
tree16de4504c006089757c7e24ee2f73fda1c840991 /challenge-142/eric-cheung
parentebaa2a75f754c837c22930e1bbbfb130034dbc94 (diff)
downloadperlweeklychallenge-club-896c415abc215829ef87d7fde92ab5c8d4ae536f.tar.gz
perlweeklychallenge-club-896c415abc215829ef87d7fde92ab5c8d4ae536f.tar.bz2
perlweeklychallenge-club-896c415abc215829ef87d7fde92ab5c8d4ae536f.zip
- Added guest contributions by Eric Cheung.
Diffstat (limited to 'challenge-142/eric-cheung')
-rwxr-xr-xchallenge-142/eric-cheung/excel-vba/Challenge_142.xlsmbin0 -> 25970 bytes
-rwxr-xr-xchallenge-142/eric-cheung/excel-vba/ch-1.bas42
-rwxr-xr-xchallenge-142/eric-cheung/python/ch-2.py19
3 files changed, 61 insertions, 0 deletions
diff --git a/challenge-142/eric-cheung/excel-vba/Challenge_142.xlsm b/challenge-142/eric-cheung/excel-vba/Challenge_142.xlsm
new file mode 100755
index 0000000000..865d40e9de
--- /dev/null
+++ b/challenge-142/eric-cheung/excel-vba/Challenge_142.xlsm
Binary files differ
diff --git a/challenge-142/eric-cheung/excel-vba/ch-1.bas b/challenge-142/eric-cheung/excel-vba/ch-1.bas
new file mode 100755
index 0000000000..aa90bb1542
--- /dev/null
+++ b/challenge-142/eric-cheung/excel-vba/ch-1.bas
@@ -0,0 +1,42 @@
+Attribute VB_Name = "ModTask_01"
+Option Explicit
+
+Public Const strMyTitle As String = "Eric Cheung"
+
+Sub Task_01()
+
+ '' Example 1
+ '' Const nNumInput As Integer = 24
+ '' Const nLastDigit As Integer = 2
+
+ '' Example 2
+ Const nNumInput As Integer = 30
+ Const nLastDigit As Integer = 5
+
+ Dim nLoop As Integer
+ Dim nCount As Integer
+
+ nCount = 0
+
+ If nLastDigit = 1 Then
+ nCount = nCount + 1
+ End If
+
+ If nNumInput Mod 10 = nLastDigit Then
+ nCount = nCount + 1
+ End If
+
+ For nLoop = 2 To nNumInput - 2
+ If _
+ nNumInput Mod nLoop = 0 _
+ And nNumInput Mod 10 = nLastDigit _
+ Then
+ nCount = nCount + 1
+ End If
+ Next nLoop
+
+ MsgBox nCount, vbOKOnly, strMyTitle
+
+End Sub
+
+
diff --git a/challenge-142/eric-cheung/python/ch-2.py b/challenge-142/eric-cheung/python/ch-2.py
new file mode 100755
index 0000000000..bc6bf07135
--- /dev/null
+++ b/challenge-142/eric-cheung/python/ch-2.py
@@ -0,0 +1,19 @@
+## Sleep Sort (For Positive Numbers)
+## Credit: https://gist.github.com/armorasha/47c7236cdfe25a928080692324d7f035
+## Credit: https://iq.opengenus.org/sleep-sort/
+## Python 3
+
+import _thread
+from time import sleep
+
+arrItem = [2, 4, 5, 2.5, 1, 7]
+
+def FuncSleepSort(nNum):
+ sleep(nNum)
+ print(nNum)
+
+
+for nItem in arrItem:
+ argItem = (nItem,)
+ _thread.start_new_thread(FuncSleepSort, argItem)
+