checksum working with file name and file path verification
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
@tool
|
||||
extends Node
|
||||
|
||||
var letter_to_number = {
|
||||
"A": 1, "B": 2, "C": 3, "D": 4, "E": 5,
|
||||
"F": 6, "G": 7, "H": 8, "I": 9, "J": 10,
|
||||
"K": 11, "L": 12, "M": 13, "N": 14, "O": 15,
|
||||
"P": 16, "Q": 17, "R": 18, "S": 19, "T": 20,
|
||||
"U": 21, "V": 22, "W": 23, "X": 24, "Y": 25, "Z": 26
|
||||
}
|
||||
|
||||
## ANGLES
|
||||
|
||||
# Check if a colliding body is aligned within a given angle of the object
|
||||
@@ -52,7 +60,21 @@ func checksum(check_data):
|
||||
var index = 0.0
|
||||
|
||||
for data in check_data:
|
||||
if data == null:
|
||||
#get value from names
|
||||
if data is String:
|
||||
var stringnumber = 0
|
||||
var letter_index = 0
|
||||
for char in data:
|
||||
if char.is_valid_identifier():
|
||||
if letter_to_number.has(char.to_upper()):
|
||||
stringnumber += letter_to_number[char.to_upper()]
|
||||
|
||||
letter_index += 1
|
||||
|
||||
print("stringnumber : ",stringnumber)
|
||||
data = stringnumber + letter_index
|
||||
|
||||
if data == null or data ==0:
|
||||
data = TAU
|
||||
if data > div:
|
||||
div = data
|
||||
|
||||
Reference in New Issue
Block a user