daily pastebin goal
77%
SHARE
TWEET

asdasd

a guest Oct 15th, 2018 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #We will assume the data structure with the valid four letter words is in a list.
  2.  
  3. import sys              # To take command line arguements.
  4.  
  5. array = [hello]
  6.  
  7. inputNum = str(sys.argv[0])
  8.  
  9.  
  10. my2DArray = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i'], ['j', 'k', 'l'], ['m', 'n', 'o'], ['p', 'q', 'r', 's'], ['t', 'u', 'v'], ['w', 'x', 'y', 'z']]
  11.  
  12. for i = 0; i < len(array); i++                                  # iterating through the each valid word in array
  13.  
  14.         for j = 0; j < len(my2DArray[numb]); j++                # iterates each possible thing the dial number could be and the letters in the word
  15.             numb - 2 = inputNum[j]                              # accounting for the number starting at 2
  16.             word = array[i]                                     # narrow the word
  17.             if(word[j] == my2DArray[numb][j])                   # check if the letter in the word is = to one of the
  18.                 if(j + 1 == len(my2DArray[numb]))
  19.                     newArray.append(array[i])
  20.                 continue
  21.             else if(j + 1 == len(my2DArray[numb]))
  22.                 i++
  23.                 break
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top