Skip to content

Instantly share code, notes, and snippets.

@graingert
graingert / 1a.java
Created February 10, 2012 16:49 — forked from anonymous/1a.java
/**
* @param word String to be turned into T9 code
* @return the T9 code of the input string
*
* Method returns the order of buttons of digipad buttons to be pressed to
* get the input String from a T9 predictive text dictionary.
*
* This method assumes the order of the buttons is as follows and ignores case:
*
* 2= a,b,c
# -*- coding: utf-8 -*-
"horfunk.radiopirate models and events handlers"
import datetime
import os
import logging
from django.db import models
from django.contrib.auth.models import User
import random
import copy
ALPHABET = ["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", " "]
class Scrambler:
"""A single scrambler unit"""
def __init__(self, seed):
self.routes = range(len(ALPHABET))
random.seed(seed)
random.shuffle(self.routes)
import random
import copy
ALPHABET = ["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", " "]
class Scrambler:
"""A single scrambler unit"""
def __init__(self, seed):
self.routes = range(len(ALPHABET))
random.seed(seed)
random.shuffle(self.routes)