Re: I need help, again!

2019-02-10 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@post 57, Thanks again. I knew about the classes, but I already set up my project in such a way that the classes would force me to rewrite the thing from scratch. Oh well, lesson learned.

URL: https://forum.audiogames.net/post/410974/#p410974




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-10 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

This has to deal with name spacing, variables made in a function live and die in that function unless passed to an outside source, so global or return functions are usually required. With return functions its more about deciding under what conditions you want to return and to perform the operations you want before hand, it might be a bit tricky in some cases, but you can always get results. There is another way to go about this though, and thats with classes. In a class, a variable can be treated as a global internally to that class, and it can have its own internal functions for manipulating that data, which can make them very useful. For example:class example(object):
 def __init__(self):
  self.index = 0
 def addtoindex(self):
  self.index += 1
 def addto(self,data):
  data += 1

box = example()
box.addtoindex()
box.addto(box.index)This class treats index as a global within itself and has two functions, addtoindex() and addto(). Addtoindex() does a simple operation on self.index and those changes are retained because self.index exists outside that function, but with addto() you'll notice we don't use the "self" prefix anywhere, so the variable data is created and dies within that function since its not being returned anywhere. You can also access the index variable externally with the name of the class and the name of the variable, like the variable we pass to addto() on the last line of the example. So, going with your resource list idea, here's an example of what that might look like:class example(object):
 def __init__(self):
  self.index = 0
  self.resource = ['wood','rock','iron','grain']
 def addtoindex(self):
  self.index += 1
 def inventory(self):
  print(self.resource[self.index])

box = example()
box.addtoindex()
box.inventory()

URL: https://forum.audiogames.net/post/410943/#p410943




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-10 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@post 55, thanks, that worked.Now: To a question of a different nature. Suppose I'm building an idel gathering game. Let's assume that we'll use a list for storing our resources. We'll use index to iterate and move through the list. The problem? The index doesn't keep it's value. what I mean is this:index = 0
def addtoindex(index):
 index+=1That code won't work. It will simply assign a value to a variable called index and won't update the index I declared above the function. However, this will work.index=0
def index():
 global index
 index+=1The problem I'm facing? Well, it's the global part. I don't want to do global x, global y, global z every time I want to change a value. That seems highly redundent. I could do return statements, but what if I don't always want to break a function by returning?While I am not building a game per say, I still am trying to learn sounds and other concepts, and this is another problem I ran into. So tips? Suggestions? Am I stuck with globals or return statements and there's no other way?

URL: https://forum.audiogames.net/post/410892/#p410892




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-09 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Oops. Sorry, lib_openal.py and such do have a pyglet dependancy, specifically they use pyglet.lib to load OpenAL.DLL. You can install pyglet, but you don't have to use any of its functions for this. Alternatively you can edit the lib scripts and try swapping this:_lib = pyglet.lib.load_library('openal', win32='openal32',
framework='/System/Library/Frameworks/OpenAL.framework')For this:_lib = ctypes.CDLL('OpenAL32.dll')And comment out import pyglet.lib.

URL: https://forum.audiogames.net/post/410725/#p410725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-09 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Oops. Sorry, lib_openal.py and such do have a pyglet dependancy, specifically they use pyglet.lib to load OpenAL.DLL. You can install pyglet, but you don't have to use any of its functions for this. Alternatively you can edit the lib scripts and try swapping this:_lib = pyglet.lib.load_library('openal', win32='openal32',
framework='/System/Library/Frameworks/OpenAL.framework')For this:_lib = ctypes.CDLL('OpenAL32.dll')

URL: https://forum.audiogames.net/post/410725/#p410725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-09 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So, @post 53, I had pyglet installed. When I removed pyglet, open al gives me the "No module named pyglet error." Tips? I would go and use pyglet, but I understand Jack shit about it, literally. I much prefer writing my own event loops, even if it breaks from time to time.

URL: https://forum.audiogames.net/post/410707/#p410707




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-09 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So, @post 53, I had pyglet installed. When I removed pyglet, open all gives me the "No module named pyglet error." Tips?

URL: https://forum.audiogames.net/post/410707/#p410707




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-09 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Hm, that seems to indicate that the version of OpenAL its finding doesn't support that OpenAL Soft function. Do you have OpenAL installed on your system? If so it could be the non-OpenAL Soft version, and its going to try and default to that over whats in the working directory, so you'll either have to overwrite the version you have installed or uninstall it.

URL: https://forum.audiogames.net/post/410692/#p410692




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-09 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Alright, we have another issue on our hands here:Here's my code. Note: A seperate test.py file is being used to run this.import sys
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(dir_path)
import lib_openal as al
import lib_alc as alc
print("Done")Here's the error I get upon running the script.Traceback (most recent call last):  
File "C:\Users\amerikranian\Desktop\python\test.py", line 6, in
import lib_alc as alc   
File "C:\Users\amerikranian\Desktop\python\lib_alc.py", line 156, in   
alcGetStringiSOFT = _lib.alcGetStringiSOFT  
File "C:\python3\lib\ctypes\__init__.py", line 369, in __getattr__
func = self.__getitem__(name)   
File "C:\python3\lib\ctypes\__init__.py", line 374, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))   
AttributeError: function 'alcGetStringiSOFT' not found  Here are the files I have in my folder:lib_openal.pylib_alc.pylib_efx.pyOpenAL32.dlltest.pySome others that just sit there without being used. They're not imported, the script above is meant to see if everything works correctly.So any tips? Edit: I just tried downloading the latest version and replacing the dll. Still no luck, same error.

URL: https://forum.audiogames.net/post/410597/#p410597




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-09 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Alright, we have another issue on our hands here:Here's my code. Note: A seperate test.py file is being used to run this.import sys
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(dir_path)
import lib_openal as al
import lib_alc as alc
print("Done")Here's the error I get upon running the script.Traceback (most recent call last):  
File "C:\Users\amerikranian\Desktop\python\test.py", line 6, in
import lib_alc as alc   
File "C:\Users\amerikranian\Desktop\python\lib_alc.py", line 156, in   
alcGetStringiSOFT = _lib.alcGetStringiSOFT  
File "C:\python3\lib\ctypes\__init__.py", line 369, in __getattr__
func = self.__getitem__(name)   
File "C:\python3\lib\ctypes\__init__.py", line 374, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))   
AttributeError: function 'alcGetStringiSOFT' not found  Here are the files I have in my folder:lib_openal.pylib_alc.pylib_efx.pyOpenAL32.dlltest.pySome others that just sit there without being used. They're not imported, the script above is meant to see if everything works correctly.So any tips?

URL: https://forum.audiogames.net/post/410597/#p410597




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: I need help, again!

I'm pretty sure iterating through the event queue is enough for pygame to handle it.

URL: https://forum.audiogames.net/post/410508/#p410508




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Like with programming languages in general, learning one can help you better understand and use others. Think of it more as gaining experience, it could prove useful in the future depending on your needs. Anyway, here's an example of Pygames mixer:import pygame
from pygame import mixer
import sys

def Example():
#initialize pygame
pygame.init()
#initialize sound mixer
mixer.init()
#create display
window = pygame.display.set_mode([640,480])
#load sound
sound = mixer.Sound('tone5.wav')

#main update loop
while True:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
#if space is pressed, play sound
if event.key == pygame.K_SPACE:
sound.play()
#if escape is pressed, quit
if event.key == pygame.K_ESCAPE:
pygame.quit()
sys.exit(0)

#update window
pygame.display.update()

Example()You can check how many instances of the sound are currently playing by using "sound.get_num_channels()", which can help you put a cap on it to prevent any overlap. You can also find the documentation for playing individual sounds and streaming sounds [here] and [here] respectively.For OpenAL, you can download my example pack [here], but reflecting on it you don't actually need to install Pyglet to use it. What you do is take the python dependancy files: lib_openal.py, lib_alc.py, and lib_efx.py, and put them in the working directory of your script along with OpenAL32.dll, then import them. In the examples included in the OpenAL pack the imports are for a Pyglet install like so:from pyglet.media.drivers.openal import lib_openal as al
from pyglet.media.drivers.openal import lib_alc as alcBut if the scripts are just in your working directory you can cut straight to:import lib_openal as al
import lib_alc as alcSo when using the examples just change the imports appropriately. The examples come with OpenAL32.DLL already, but if you need to get it elsewhere or the latest version go to [OpenAL-Soft] and download the latest release, which is currently 1.19.1, unpack it and head into the /bin/x32 or /bin/x64 directories, depending. Rename either of the soft_oal.dll files to OpenAL32.dll, and copy it to your working directory with the py scripts, and you should be good to go.

URL: https://forum.audiogames.net/post/410502/#p410502




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Like with programming languages in general, learning one can help you better understand and use others. Think of it more as gaining experience, it could prove useful in the future depending on your needs. Anyway, here's an example of Pygames mixer:import pygame
from pygame import mixer
import sys

def Example():
#initialize pygame
pygame.init()
#initialize sound mixer
mixer.init()
#create display
window = pygame.display.set_mode([640,480])
#load sound
sound = mixer.Sound('tone5.wav')

#main update loop
while True:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
#if space is pressed, play sound
if event.key == pygame.K_SPACE:
sound.play()
#if escape is pressed, quit
if event.key == pygame.K_ESCAPE:
pygame.quit()
sys.exit(0)

#update window
pygame.display.update()

Example()You can check how many instances of the sound are currently playing by using "sound.get_num_channels()", which can help you put a cap on it to prevent any overlap. You can also find the documentation for playing individual sounds and streaming sounds [here] and [here] respectively.For OpenAL, you can download my example pack [here], but reflecting on it you don't actually need to install Pyglet to use it. What you do is take the python dependancy files: lib_openal.py, lib_alc.py, and lib_efx.py, and put them in the working directory of your script along with OpenAL32.dll, then import them. In the examples included in the OpenAL pack the imports are for a Pyglet install like so:from pyglet.media.drivers.openal import lib_openal as al
from pyglet.media.drivers.openal import lib_alc as alcBut if the scripts are just in your working directory you can cut straight to:import lib_openal as al
import lib_alc as alcSo when using the examples just change the imports appropriately. To get the OpenAL DLL go to [OpenAL-Soft] and download the latest release, which is currently 1.19.1, unpack it and head into the /bin/x32 or /bin/x64 directories, depending. Rename either of the soft_oal.dll files to OpenAL32.dll, and copy it to your working directory with the py scripts, and you should be good to go.

URL: https://forum.audiogames.net/post/410502/#p410502




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Wild 2D audio would be nice for a bit, I feel like I will be doing myself a disservice.  I feel like it’s much better to pick a set of tools and stick with them, rather than pick a set of tools and then switch to new ones later.  I would appreciate any tips and/or instructions you can offer downloading the library and or using it.

URL: https://forum.audiogames.net/post/410496/#p410496




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

If you run your script from another directory, it would use your current directory as the working one, for example:C:\yourdir> python yourscript.pyThis would make the current directory where you run your script the current working directory, but this:C:\> python yourdir/yourscript.pyWould make C: the working directory, and not the directory of the script and the files it contains. I'm not sure if a misconfigured IDE like notepad++ could cause an import issue like this, but its something to keep in mind. pygame.display.update() is also more to make the window less janky and more responsive when moving it around. Even if your not using the window or displaying things, it still creates a window and should be considered a matter of best practice to help keep things smooth.If your going with the example script I used there shouldn't be much of a delay exactly, I changed it so when a key is released it plays the string, as opposed to pressed. This way, if someone holds down the button it won't spam the string and cause playback issues, but it won't trigger until you let go of the key. There are other ways of writing it to handle on key presses, but that was just for that particular example. Pygame can also handle 2D audio, although i'm going to assume you'd prefer 3D audio. I've been meaning to look into a less complex way of setting up and using OpenAL bindings, if your interested in that or any examples for pygames audio I can put something together.

URL: https://forum.audiogames.net/post/410485/#p410485




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Sorry if i'm not responding much, things have been pretty crazy the past few weeks. If you run your script from another directory, it would use your current directory as the working one, for example:C:\yourdir> python yourscript.pyThis would make the current directory where you run your script the current working directory, but this:C:\> python yourdir/yourscript.pyWould make C: the working directory, and not the directory of the script and the files it contains. I'm not sure if a misconfigured IDE like notepad++ could cause an import issue like this, but its something to keep in mind. pygame.display.update() is also more to make the window less janky and more responsive when moving it around. Even if your not using the window or displaying things, it still creates a window and should be considered a matter of best practice to help keep things smooth.If your going with the example script I used there shouldn't be much of a delay exactly, I changed it so when a key is released it plays the string, as opposed to pressed. This way, if someone holds down the button it won't spam the string and cause playback issues, but it won't trigger until you let go of the key. There are other ways of writing it to handle on key presses, but that was just for that particular example. Pygame can also handle 2D audio, although i'm going to assume you'd prefer 3D audio. I've been meaning to look into a less complex way of setting up and using OpenAL bindings, if your interested in that or any examples for pygames audio I can put something together.

URL: https://forum.audiogames.net/post/410485/#p410485




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@Post 46, I thought pygame.event.pump was for keeping the event list clean and prevent it from filling up? Do let me know how do I not use it accessively.

URL: https://forum.audiogames.net/post/410466/#p410466




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: I need help, again!

I did notice that in your code you call the pygame event pump function unnecessarily. It could be that function since you're calling it a lot.

URL: https://forum.audiogames.net/post/410424/#p410424




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-08 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So an update: I've figured out the delay issue, I think. I have built several small projects, couple of dice games to be exact, and I think I'm ready to add in another layer, sound. I have done some research, and a popular library to use in here is sound_lib. Trouble is, there's just code. While I can go look through it and try and figure it out, I was wondering if anybody had an example of how to use sound_lib, as searching for docs for sound_lib didn't produce promising results.

URL: https://forum.audiogames.net/post/410411/#p410411




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-04 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Yea! Alridy! it works! Any idea why the script wasn't in it's default directory originally? Why do I need to do pygame.display.update() if I'm planning to only use the audio? Also, you're right, the input is slightly delayed. Is it because of the way the pygame processes events? Or is it do to the way you and I coded it. If if it's the ladder, I would appreciate any tips to improve the the responsiveness. It's fine for what I have in mind, but for games like simon I would like some faster reactions.

URL: https://forum.audiogames.net/post/409520/#p409520




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-04 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Hm, try putting the following code at the beginning of your script, before you import Tolk:import sys
import os

#check the current working directory
print(os.getcwd())

#get the current directory of your script
dir_path = os.path.dirname(os.path.realpath(__file__))

#set the current working directory to your script
os.chdir(dir_path)If the working directory isn't where your script is, then it may not be able to find the DLL to load it. The code above should set the current working directory to the script itself, if you run it directly.

URL: https://forum.audiogames.net/post/409517/#p409517




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-04 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@post 41, thank you for the info. @post 38: Right, your example gave the same results. Furthermore, when I did pip install tolk and tried importing the thing it gave me an error about the handler module not being there, and I checked, it is in the same folder as __init__.py. So yeah, I think it's my setup. As for c++, I had the 2017 distribution, so I couldn't install 2013 and 2015 because they gave me "the newer version is better than the product" message. So now what do you suggest me try? Could it be the problem with my python directory? It's in c:\python3 right now. I'm pretty sure there is no multiple python versions on my PC because when I go to programs and have an option to uninstall them I have the python launcher and python3.7.2, nothing else. I really don't wana go back to earlier versions if I can help it.

URL: https://forum.audiogames.net/post/409510/#p409510




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-04 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@post 41, thank you for the info. @post 38: Right, your example gave the same results. Furthermore, when I did pip install tolk and tried importing the thing it gave me an error about the handler module not being there, and I checked, it is in the same folder as __init__.py. So yeah, I think it's my setup. As for c++, I had the 2017 distribution, so I couldn't install 2013 and 2015 because they gave me "the newer version is better than the product" message. So now what do you suggest me try? Could it be the problem with my python directory? It's in c:\python3 right now. I'm pretty sure there is no multiple python versions on my PC because when I go to programs and have an option to uninstall them I have the python launcher and python3.7.2, nothing else.

URL: https://forum.audiogames.net/post/409510/#p409510




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-04 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: I need help, again!

The loop problems from what I can see aren't caused by Tolk. There are a few logic errors.In the menu module you haven't imported pygame. For every module you import that module needs to import required modules. K_UP and K_DOWN are defined in the pygame module itself, so those need to be pygame.K_UP and pygame.K_DOWN.The run function iterates through the event queue, which is fine. However as soon as the event queue is empty the program will stop executing. To fix this wrap the repeating menu logic  (including the event queue iteration) in a while loop.

URL: https://forum.audiogames.net/post/409489/#p409489




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-04 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@post 38: I will try your suggestions as soon as I get home, which should be in a little over 2 hours. @post 39. Thing is, I can't do the method described. I don't have the Tolk library installed, I only have the files. There's no setup.py or anything, and I don't know how to install packages manually. Thing is, the error doesn't happen if my program has no loops. It only happens if there are loops of any sort. Furthermore, the interactive prompt will simply say "No module named Tolk", where as my script gives me error pertaining to the Tolk file itself. The error can be found in post 33.

URL: https://forum.audiogames.net/post/409483/#p409483




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-04 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: I need help, again!

Another idea before getting into experimentation stage myself, did you try inserting the errorneous script into an interactive python prompt line by line to see if the same error pops up as soon as the tolk import happens? Maybe this one will fix your problem. In the end there is still the possibility that python 3 is at fault here and raises the wrong error message here, so something could theoretically mess the stack trace up here. You can track this problem down by using the previously mentioned method of interpreting each line after another and see where exactly the error shows up.Best Regards.Hijacker

URL: https://forum.audiogames.net/post/409444/#p409444




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

I'm actually using the x86 Tolk binaries, they should work just as well on an x64 windows platform, so you could try swapping those over and see if it makes a difference, and yeah having them in the same folder should do it, either that or it could be something with your environment setup. You can download the files I used [here], for the 126 error other posts around suggest installing Visual C++ redistributables for [2013] or [2015],  you could also try downgrading to earlier versions of python to see if that works.

URL: https://forum.audiogames.net/post/409378/#p409378




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

First, thanks for taking the time to answer despite the cold. Second, I'm afraid we still have the persisting 126, can't find the module errors when running your example on my end. Would you mind uploading your version of Tolk assuming you didn't download the one I linked to in post 35?I have the Tolk.py from the src/python folder and the Tolk.dll from bin/64 folder as well.As for screenreaders being included, I have both nvda and sapi64.dlls in the same folder I have my script, Tolk.dll, and Tolk.py files. Is that all I need to do? I'm also using python 3.7.2 and am on windows 8 if my memory serves me correctly, python is grater then 3.6.4, at least.

URL: https://forum.audiogames.net/post/409367/#p409367




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

First, thanks for taking the time to answer despite the cold. Second, I'm afraid we still have the persisting 126, can't find the module errors on my end. Would you mind uploading your version of Tolk assuming you didn't download the one I linked to in post 35?As for screenreaders being included, I have both nvda and sapi64.dlls in the same folder I have my script, Tolk.dll, and Tolk.py files. Is that all I need to do? I'm also using python 3.7.2 and am on windows 8 if my memory serves me correctly, python is grater then 3.6.4, at least.

URL: https://forum.audiogames.net/post/409367/#p409367




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

First, thanks for taking the time to answer despite the cold. Second, I'm afraid we still have the persisting 126, can't find the module errors on my end. Would you mind uploading your version of Tolk assuming you didn't download the one I linked to in post 35?As for screenreaders being included, I have both nvda and sapi64.dlls in the same folder I have my script, Tolk.dll, and Tolk.py files. Is that all I need to do? I'm also using python 3.7.2 if my memory serves me correctly, it's grater then 3.6.4, at least.

URL: https://forum.audiogames.net/post/409367/#p409367




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

I don't think you need to pass Tolk to functions, as it acts as a global class. Also remember to include the screen reader driver dll's from the tolk archive in /lib/x64 if your using the 64 bit version, or /lib/x32 for 32 bit.In this example you gave:import time
import pygame
import Tolk
from pygame.locals import *
Tolk.load()
pygame.init()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
while 1:
 for event in pygame.event.get():
  if event.type==KEYDOWN:
   if event.KEY==K_LEFT:
time.sleep(3)
Tolk.output("Testing testing 1 2 3.")
time.sleep(3)
breakIn line 12 you put KEY in all caps, which it won't recognise so you can't start the tts test, also putting in the sleep functions seems to mess with it. I'm running it with python 2.7, it was pretty unresponsive, but did work if holding or repeatedly tapping left. I adjusted it abit and this seems to work:import pygame
import Tolk
import sys
from pygame.locals import *

pygame.init()

Tolk.load()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
while 1:
 for event in pygame.event.get():
  if event.type==KEYUP:
   if event.key==K_LEFT:
Tolk.silence()
Tolk.output("Testing testing 1 2 3.")
   elif event.key==K_ESCAPE:
Tolk.unload()
pygame.quit()
sys.exit(0)
  pygame.display.update()I'm going to go back to being face punched by a cold now...

URL: https://forum.audiogames.net/post/409352/#p409352




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

That's the thing: The script is in the exact same folder as the other ones were. Hell, it's even in the same file! The problem is encountered only when I try and do loops, which crashes the program. The scripts work fine, I used sys.exit(0) to proove it and commented out Tolk lines of code. I have Tolk.dll and Tolk.py, and they work beautifully, as long as I don't use any loops, but I can build minimal things with that.I only got 1 script. 1 script that I use, and another one that imports my menu class, is commented out. I do the exact same thing, I pasted the scripts from the file as I wrote the damn things.I also do everything just like I normally do: That is, cd c:\python3, then py -3 and then my script paths. It's just that one script works and the other one doesn't. I have no clue as to why it does it. If you could download Tolk from here and run my scripts provided you have python 3 and pygame then post on here about the results I'd be extremely grateful. The worst thing that could happen is you not getting the same error, as it would mean that something is broken on my end. If you don't have pygame but you have pip installed, just do pip install pygame. Edit: Somebody also asked me why can't you use accessible_output? Great idea! Except there's a problem. I don't have a module named braille, even though it is in the damn thing's folder, so it should see it... By this point I'm willing to try anything. If you think you can guide me through setting up accessible_output, go ahead. I'll take anything that functions as speech, as I, go figure, know little to nothing about this area of coding. Hell, this is as far as I ever gotten with any other language besides bgt.Edit 2: The issue still persists: I redownloaded Tolk because the link in post 26 no longer works. Cool, right? Nope. It fixed literally nothing. Is anybody else using Tolk with pygame, or am I just a fool for trying it?

URL: https://forum.audiogames.net/post/409330/#p409330




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

That's the thing: The script is in the exact same folder as the other ones were. Hell, it's even in the same file! The problem is encountered only when I try and do loops, which crashes the program. The scripts work fine, I used sys.exit(0) to proove it and commented out Tolk lines of code. I have Tolk.dll and Tolk.py, and they work beautifully, as long as I don't use any loops, but I can build minimal things with that.I only got 1 script. 1 script that I use, and another one that imports my menu class, is commented out. I do the exact same thing, I pasted the scripts from the file as I wrote the damn things.I also do everything just like I normally do: That is, cd c:\python3, then py -3 and then my script paths. It's just that one script works and the other one doesn't. I have no clue as to why it does it. If you could download Tolk from here and run my scripts provided you have python 3 and pygame then post on here about the results I'd be extremely grateful. The worst thing that could happen is you not getting the same error, as it would mean that something is broken on my end. If you don't have pygame but you have pip installed, just do pip install pygame. Edit: Somebody also asked me why can't you use accessible_output? Great idea! Except there's a problem. I don't have a module named braille, even though it is in the damn thing's folder, so it should see it... By this point I'm willing to try anything. If you think you can guide me through setting up accessible_output, go ahead. I'll take anything that functions as speech, as I, go figure, know little to nothing about this area of coding. Hell, this is as far as I ever gotten with any other language besides bgt.

URL: https://forum.audiogames.net/post/409330/#p409330




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

That's the thing: The script is in the exact same folder as the other ones were. Hell, it's even in the same file! The problem is encountered only when I try and do loops, which crashes the program. The scripts work fine, I used sys.exit(0) to proove it and commented out Tolk lines of code. I have Tolk.dll and Tolk.py, and they work beautifully, as long as I don't use any loops, but I can build minimal things with that.I only got 1 script. 1 script that I use, and another one that imports my menu class, is commented out. I do the exact same thing, I pasted the scripts from the file as I wrote the damn things.I also do everything just like I normally do: That is, cd c:\python3, then py -3 and then my script paths. It's just that one script works and the other one doesn't. I have no clue as to why it does it. If you could download Tolk from a link that no longer works and run my scripts provided you have python 3 and pygame then post on here about the results I'd be extremely grateful. The worst thing that could happen is you not getting the same error, as it would mean that something is broken on my end. If you don't have pygame but you have pip installed, just do pip install pygame. Edit: So I just found out that the Tolk link which I linked to in post 26 is broken. That makes me suspect that I have a corrupted version. I'll try and find it again and will report back when I do. Somebody also asked me why can't you use accessible_output? Great idea! Except there's a problem. I don't have a module named braille, even though it is in the damn thing's folder, so it should see it... By this point I'm willing to try anything. If you think you can guide me through setting up accessible_output, go ahead. I'll take anything that functions as speech, as I, go figure, know little to nothing about this area of coding. Hell, this is as far as I ever gotten with any other language besides bgt.

URL: https://forum.audiogames.net/post/409330/#p409330




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

That's the thing: The script is in the exact same folder as the other ones were. Hell, it's even in the same file! The problem is encountered only when I try and do loops, which crashes the program. The scripts work fine, I used sys.exit(0) to proove it and commented out Tolk lines of code. I have Tolk.dll and Tolk.py, and they work beautifully, as long as I don't use any loops, but I can build minimal things with that.I only got 1 script. 1 script that I use, and another one that imports my menu class, is commented out. I do the exact same thing, I pasted the scripts from the file as I wrote the damn things.I also do everything just like I normally do: That is, cd c:\python3, then py -3 and then my script paths. It's just that one script works and the other one doesn't. I have no clue as to why it does it. If you could download Tolk from here and run my scripts provided you have python 3 and pygame then post on here about the results I'd be extremely grateful. The worst thing that could happen is you not getting the same error, as it would mean that something is broken on my end. If you don't have pygame but you have pip installed, just do pip install pygame.

URL: https://forum.audiogames.net/post/409330/#p409330




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: I need help, again!

Hi,looks like a problem which encounters directly when importing Tolk. Please make sure you're running both scripts with the same python version and from within the same working directory. I often encounter things like a virtual environment within one project which is working fine, and the global installation within a separate script directory which doesn't work, but you'll invoke both scripts by typing "python script.py". Python 2 and Python 3 might work differently here as well, even though they might both be callable by using "python script.py". If you got python 3 with the launcher installed, trypy -3 script.py instead, or py -2 if you want to use python 2 respectively.This doesn't seem to be an issue regarding the scripts you provided though. The question more likely is which environment settings differ from running the first script to running the second and third one, because the first one works and the other two don't. I'd guess you need to copy certain dll files over to the folder the second and third script are running in which are currently present within the folder where the first script can be found.Best Regards.Hijacker

URL: https://forum.audiogames.net/post/409315/#p409315




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: I need help, again!

Hi,looks like a problem which encounters directly when importing Tolk. Please make sure you're running both scripts with the same python version and from within the same working directory. I often encounter things like a virtual environment within one project which is working fine, and the global installation within a separate script directory which doesn't work, but you'll invoke both scripts by typing "python script.py". Python 2 and Python 3 might work differently here as well, even though they might both be callable by using "python script.py". If you got python 3 with the launcher installed, trypy -3 script.py instead, or py -2 if you want to use python 2 respectively.This doesn't seem to be an issue regarding the scripts you provided though. The question more likely is which environment settings differ from running the first script to running the second and third one, because the third one works and the other two don't. I'd guess you need to copy certain dll files over to the folder the second and third script are running in which are currently present within the folder where the first script can be found.Best Regards.Hijacker

URL: https://forum.audiogames.net/post/409315/#p409315




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Right, so more info if yall can help me here. I think there is a problem with the Tolk file I got. The following script works like it should:import time
import pygame
import Tolk
from pygame.locals import *
Tolk.load()
pygame.init()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
time.sleep(6)
Tolk.output("Testing.")
time.sleep(4)
Tolk.output("Testing again.")
time.sleep(4)
Tolk.output("Testing a third time because why not.")
time.sleep(4)The program goes unresponsive, but that's expected. The important bit is Tolk reading the messages and passing them through. The following script doesn't work, however.import time
import pygame
import Tolk
from pygame.locals import *
Tolk.load()
pygame.init()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
while 1:
 for event in pygame.event.get():
  if event.type==KEYDOWN:
   if event.KEY==K_LEFT:
time.sleep(3)
Tolk.output("Testing testing 1 2 3.")
time.sleep(3)
breakThis version of the code also doesn't work:import time
import pygame
import Tolk
import sys
from pygame.locals import *
Tolk.load()
pygame.init()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
while 1:
 for event in pygame.event.get():
  if event.type==QUIT:
   sys.exit(0)
  if event.type==KEYDOWN:
   if event.key==K_LEFT:
Tolk.output("Exiting.")
time.sleep(3)
sys.exit(0)
 pygame.event.pump()The error I get from this is this:import Tolk 
  File "C:\Users\amerikranian\Desktop\python\Tolk.py", line 11, in   
_tolk = cdll.Tolk   
  File "C:\python3\lib\ctypes\__init__.py", line 426, in __getattr__
dll = self._dlltype(name)   
  File "C:\python3\lib\ctypes\__init__.py", line 356, in __init__   
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found Again, tips, suggestions, anything? You can try and upload your version of Tolk, see if that fixes things, I'm using windows 64.

URL: https://forum.audiogames.net/post/409286/#p409286




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Right, so more info if yall can help me here. I think there is a problem with the Tolk file I got. The following script works like it should:import time
import pygame
import Tolk
from pygame.locals import *
Tolk.load()
pygame.init()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
time.sleep(6)
Tolk.output("Testing.")
time.sleep(4)
Tolk.output("Testing again.")
time.sleep(4)
Tolk.output("Testing a third time because why not.")
time.sleep(4)The program goes unresponsive, but that's expected. The important bit is Tolk reading the messages and passing them through. The following script doesn't work, however.import time
import pygame
import Tolk
from pygame.locals import *
Tolk.load()
pygame.init()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
while 1:
 for event in pygame.event.get():
  if event.type==KEYDOWN:
   if event.KEY==K_LEFT:
time.sleep(3)
Tolk.output("Testing testing 1 2 3.")
time.sleep(3)
breakThe code works, but this version of it doesn't:import time
import pygame
import Tolk
import sys
from pygame.locals import *
Tolk.load()
pygame.init()
screen = pygame.display.set_mode((150, 50))
pygame.display.set_caption("Test program.")
while 1:
 for event in pygame.event.get():
  if event.type==QUIT:
   sys.exit(0)
  if event.type==KEYDOWN:
   if event.key==K_LEFT:
Tolk.output("Exiting.")
time.sleep(3)
sys.exit(0)
 pygame.event.pump()The error I get from this is this:import Tolk 
  File "C:\Users\amerikranian\Desktop\python\Tolk.py", line 11, in   
_tolk = cdll.Tolk   
  File "C:\python3\lib\ctypes\__init__.py", line 426, in __getattr__
dll = self._dlltype(name)   
  File "C:\python3\lib\ctypes\__init__.py", line 356, in __init__   
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found Again, tips, suggestions, anything? You can try and upload your version of Tolk, see if that fixes things, I'm using windows 64.

URL: https://forum.audiogames.net/post/409286/#p409286




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

I do. I have the Tolk files in there. Thing is, the Tolk works in the main file, and in the menu file if I add it to any other function but run. When I add it to run function, the program crashes, though it does the same without it, as well. My code is short, and I really think that something's is wrong with my run function. It's in the link in my last post of the thread, but I'll post the code in here, as well. def run(self, Tolk):
  choice = 0
  if len(self.menu_choices)==0:
   return -2
  Tolk.output(str(self.menu_choices.get(choice)), True)
  for event in pygame.event.get():
   if event.type == KEYDOWN:
if event.key == K_UP and choice>0:
 choice-=1
 Tolk.output(str(self.menu_choices.get(choice)), True)
elif event.key == K_DOWN and choice  If anybody could shed some light on here I'd be extremely grateful. Also, you may ask me how am I sure that the bug is in the run function? It's simple. I tested out every other function, passing Tolk as it's params, and it worked like a charm. I think my issue is not with Tolk, but with pygame itself. I wouldn't be surprised if it's a simple matter of capitalization.

URL: https://forum.audiogames.net/post/409155/#p409155




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-02 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

I do. I have the Tolk files in there. Thing is, the Tolk works in the main file, and in the menu file if I add it to any other function but run. When I add it to run function, the program crashes, though it does the same without it, as well. My code is short, and I really think that something's is wrong with my run function. It's in the link in my last post of the thread, but I'll post the code in here, as well. def run(self, Tolk):
  choice = 0
  if len(self.menu_choices)==0:
   return -2
  Tolk.output(str(self.menu_choices.get(choice)), True)
  for event in pygame.event.get():
   if event.type == KEYDOWN:
if event.key == K_UP and choice>0:
 choice-=1
 Tolk.output(str(self.menu_choices.get(choice)), True)
elif event.key == K_DOWN and choice  If anybody could shed some light on here I'd be extremely grateful. I'd also like to see this done as a while loop, just because I have a strong dislike and I force myself to overcome those. But again, right now I'm just trying to get this to work, I can figure out while loops later. Also, you may ask me how am I sure that the bug is in the run function? It's simple. I tested out every other function, passing Tolk as it's params, and it worked like a charm. I think my issue is not with Tolk, but with pygame itself. I wouldn't be surprised if it's a simple matter of capitalization.

URL: https://forum.audiogames.net/post/409155/#p409155




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-02 Thread AudioGames . net Forum — Developers room : The Dwarfer via Audiogames-reflector


  


Re: I need help, again!

do you have the tolk.dll file in the same directory as your script? Tolk.py should be in there as well.b

URL: https://forum.audiogames.net/post/409123/#p409123




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-02 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So @Ethin, I think I figured out what you meant by dlls not working. I currently have an issue with creating a menu class and using Tolk to speak it. The tolk works great in the main file, but as soon as I try and pass it to my loop for the menu things break, badly. See what I mean by going Here I admit, even that bit of code took me a bit to test and debug, but now the program simply closes without anything. No good bye, no errors to help me, nothing as far as I can see, until I run the damn thing through the command line prompt.To hopefully get the same error as me, open cmd, do cd and then the path to the folder where your copy of python3.exe is located at, then do py -3 path to myscript.py.  If you're getting the OS 126: Can't find the module, error, good. We're on the same page. Thing is, Tolk works just fine in the normal file. I checked my pygame functions, and they were all the same as the documentation found right here, as far as I know. The problem is that this is something I can't debug do to the lack of knowledge. I was gonna use a menu to create guess the number and higher or lower, just to see how my skills fair up against multiple files. So tips? Suggestions? Anything? I'm truly stumped. I checked all I knew to check. Indentation seems to be fine, I didn't forget any colons as far as I know, but the run function in the menu class seems to disagree. I've spent 2 hours on it with no headway, so I'd appreciate any help.

URL: https://forum.audiogames.net/post/409048/#p409048




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-02 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So @Ethin, I think I figured out what you meant by dlls not working. I currently have an issue with creating a menu class and using Tolk to speak it. The tolk works great in the main file, but as soon as I try and pass it to my loop for the menu things break, badly. See what I mean by going Here I admit, even that bit of code took me a bit to test and debug, but now the program simply closes without anything. No good bye, no errors to help me, nothing as far as I can see, until I run the damn thing through the command line prompt.To hopefully get the same error as me, open cmd, do cd and then the path to the folder where your copy of python3.exe is located at, then do py -3 path to myscript.py.  If you're getting the OS 126: Can't find the module, error, good. We're on the same page. Thing is, Tolk works just fine in the normal file. I checked my pygame functions, and they were all the same as the documentation found right here, as far as I know. The problem is that this is something I can't debug do to the lack of knowledge. I was gonna use a menu to create guess the number and higher or lower, just to see how my skills fair up against multiple files. So tips? Suggestions? Anything? I'm truly stumped. I checked all I knew to check. Indentation seems to be fine, I didn't forget any colons as far as I know, but the run function in the menu class seems to disagree. I've spent 2 hours on it with no headway, so I'd appreciate any help. As a side note, if you're wondering why are there useless files in the folder, I added them because I wasn't sure if the module was complaining about the lack of files. It's not, like I said, the issue is with Menu.py in it's run function, as commenting m.run in my script works, and the program goes dead like expected.

URL: https://forum.audiogames.net/post/409048/#p409048




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-02-02 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So @Ethin, I think I figured out what you meant by dlls not working. I currently have an issue with creating a menu class and using Tolk to speak it. The tolk works great in the main file, but as soon as I try and pass it to my loop for the menu things break, badly. See what I mean by going Here I admit, even that bit of code took me a bit to test and debug, but now the program simply closes without anything. No good bye, no errors to help me, nothing as far as I can see, until I run the damn thing through the command line prompt.To hopefully get the same error as me, open cmd, do cd and then the path to the folder where your copy of python3.exe is located at, then do py -3 path to myscript.py.  If you're getting the OS 126: Can't find the module, error, good. We're on the same page. Thing is, Tolk works just fine in the normal file. I checked my pygame functions, and they were all the same as the documentation found right here, as far as I know. The problem is that this is something I can't debug do to the lack of knowledge. I was gonna use a menu to create guess the number and higher or lower, just to see how my skills fair up against multiple files. So tips? Suggestions? Anything? I'm truly stumped. I checked all I knew to check. Indentation seems to be fine, I didn't forget any colons as far as I know, but the run function in the menu class seems to disagree. I've spent 2 hours on it with no headway, so I'd appreciate any help.

URL: https://forum.audiogames.net/post/409048/#p409048




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-31 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

1: no, pygame does not restrict your usage of anything. You are free to use whatever you like (even other event handlers alongside the main one) but I wouldn't if I were you.2: a module is one of three things:* a .py file that can be imported with the import statement* a collection of python files that can be imported with the import statement (i.e. the numpy package is a large collection of python files that is imported when you use import numpy)* A DLL or Python extension written in another programming language that is capable of both interfacing with Python and creating DLLs that are linked against the Python interpreter you are usingIn the case of the third possibility, the extension must be linked against the exact Python version your using (i.e. you can't use an extension written for Python 3.6 in Python 3.7 and vice versa). That is the major downside to extensions written in other programming languages, but they are still very useful.3: yes, it is. The reasons I can think of for the program not doing anything are quite a lot, but I'll give the most common:* you do not have an event handler to process events (i.e. mouse buttons, keyboard key presses/releases, etc.) or you have one but it is not running* Another function call has blocked the main Python thread and the function has not returned controlA typical pygame event loop looks like:def event_loop():
pygame.event.pump()A good practice that you should adopt when making a game is to only have one event handler. You don't need tons of while loops for your event handler to function properly, something like a background thread that calls your event handler over and over is fine. The more event handlers you have running simultaneously the higher the risk that you will "lose" an event; that is, an event is sent by the OS, but is never caught because an event handler didn't execute fast enough because another was hogging the thread. So make an event handler that places event data in a globally accessible structure and reference that. This advice becomes especially important when you use frameworks like SDL2.

URL: https://forum.audiogames.net/post/408632/#p408632




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-31 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So I have a couple of questions.1: Say I want to use pygame for my window creation, would it restrict me from using certain functions in python itself? Pretty silly, I know, but I want to check.2: What is the difference between a class and a module? I mean is class a module if you save it to a file? Could a class  be considered a module? Are there different rules concerning the variable scope between the two?3: Is it normal if I create a pygame window and after running it getting the This program stopped responding statement? I'm asking because the window does nothing, it just sits there until you kill it with task manager. @Ethan, thanks for the tip, gonna try it after I get home.

URL: https://forum.audiogames.net/post/408621/#p408621




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-31 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So I have a couple of questions.1: Say I want to use pygame for my window creation, would it restrict me from using certain functions in python itself? Pretty silly, I know, but I want to check.2: What is the difference between a class and a module? I mean is class a module if you save it to a file? Could a class  be considered a module? Are there different rules concerning the variable scope between the two?3: Is it normal if I create a pygame window and after running it getting the This program stopped responding statement? I'm asking because the window does nothing, it just sits there until you kill it with task manager.

URL: https://forum.audiogames.net/post/408621/#p408621




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-30 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

You put tolk.py and tolk.dll in the same location as your script.

URL: https://forum.audiogames.net/post/408476/#p408476




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-30 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So I wanted to be able to get the user to hear stuff from their screen reader, and doing a bit of research yielded  Tolk, direct download link I looked at the tolk.h file, and it's pretty understandable. My issue? Well, uh, I can't import it? Where do I paste in the modules to be imported/what exactly do I paste? Do I paste in the entire src folder somewhere? Do I paste in the .h file somewhere? Highly doubtful... Does the script I run require the lib folder within the directory it's run from? If so, where do I paste the library to if I want the console, you know, the thingy that pops up after you type in python into the running prompt, to not give me errors stating that it can't find a module named Tolk.

URL: https://forum.audiogames.net/post/408458/#p408458




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-25 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Right, I believe the indention problems are completely fixed now. Now you can run the thing and it should... work?

URL: https://forum.audiogames.net/post/407428/#p407428




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-24 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

That's OK

URL: https://forum.audiogames.net/post/407302/#p407302




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-24 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

OK. It’s done. I did it on an iPhone, so I apologize for any indention errors.

URL: https://forum.audiogames.net/post/407281/#p407281




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-24 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So while failing at an affine cipher, I decided to take a break. Sometimes it helps, sometimes it doesn't. In short, I coded something else: Note, replace 2, 3, and 4 greater than signs with spaces. Then go to every function and edit the top of it, up till the loop starts. I'm sorry, but there isn't an easier way for me to do this, the forum trims my spaces. Anyways, here you go.def factor(xs, factornum):
 x1 = 1
 x2 = 1
 isfactored = False
 while isfactored==False:
  z = x1*x2
  if z==factornum:
   w = x1+x2
   if w==xs:
print( str(x1)+" "+str(x2))
>>>>return
  if x2>factornum:
>>>x2=1
   x1+=1
  if x1>factornum:
   print("Unfactorable _expression_.")
   return
  x2+=1

def negfactor(xs, factornum):
 x1 = -1
 x2 = -1
 isfactored=False
 while isfactored==False:
  z = x1*x2
  if z==factornum:
   w = x1+x2
   if w==xs:
print(str(x1)+" "+str(x2))
return
  if x2factornum+factornum*-2:
   x2=1
   x1-=1
  if x10 and factornum>0:
  factor(xs, factornum)
 elif xs <0 and factornum >0:
  negfactor(xs, factornum)
 elif xs >0 and factornum <0:
  hybrid(xs, factornum)
 else:
  print("It appears that you gave an invalid number. Try again.")Completely useless, I know, but something fun on the side. Also, let me know if you see any potential issues. I know you can crash the script by giving it letters or too big of a number, I'm looking into try statements to fix that problem as I write this.

URL: https://forum.audiogames.net/post/407250/#p407250




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-24 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

Have you considered using code tags? Like (replace left and right bracket with the actual chars, the forum provides no way of escaping BBCode):left bracket code right bracketdef hi():    returnleft bracket /code right bracket

URL: https://forum.audiogames.net/post/407253/#p407253




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-24 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

Have you considered using code tags? Like:[[]]
Test
[[]]

URL: https://forum.audiogames.net/post/407253/#p407253




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-24 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So while failing at an affine cipher, I decided to take a break. Sometimes it helps, sometimes it doesn't. In short, I coded something else: Note, replace 2, 3, and 4 greater than signs with spaces. Then go to every function and edit the top of it, up till the loop starts. I'm sorry, but there isn't an easier way for me to do this, the forum trims my spaces. Anyways, here you go.def factor(xs, factornum):>x1 = 1>x2 = 1>isfactored = False>while isfactored==False:>>z = x1*x2>>if z==factornum:>>>w = x1+x2>>>if w==xs:>>>>print( str(x1)+" "+str(x2))>>>>return>>if x2>factornum:>>>x2=1>>>x1+=1>>if x1>factornum:>>>print("Unfactorable _expression_.")>>>return>>x2+=1def negfactor(xs, factornum):>x1 = -1>x2 = -1>isfactored=False>while isfactored==False:>>z = x1*x2>>if z==factornum:>>>w = x1+x2>>>if w==xs:>>>>print(str(x1)+" "+str(x2))>>>>return>>if x2>>>x2=-1>>>x1-=1>>if x1>>>print("Unfactorable _expression_.")>>>return>>x2-=1def hybrid(xs, factornum):>x1=-1>x2=1>isfactored=False>while isfactored==False:>>z = x1*x2>>if z==factornum:>>>w = x1+x2>>>if w==xs:>>>>print(str(x1)+" "+str(x2))>>>>return>>if x2>factornum+factornum*-2:>>>x2=1>>>x1-=1>>if x1>>>print( "Unfactorable _expression_.")>>>return>>x2+=1def begin(xs, factornum):>if xs >0 and factornum>0:>>factor(xs, factornum)>elif xs <0 and factornum >0:>>negfactor(xs, factornum)>elif xs >0 and factornum <0:>>hybrid(xs, factornum)>else:>>print("It appears that you gave an invalid number. Try again.")Completely useless, I know, but something fun on the side. Also, let me know if you see any potential issues. I know you can crash the script by giving it letters or too big of a number, I'm looking into try statements to fix that problem as I write this.

URL: https://forum.audiogames.net/post/407250/#p407250




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-16 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: I need help, again!

Normally the ^ operator is exponentiation (2^2 = 2 squared, 2^3 = 2 cubed, etc). In python though ^ is the bitwise  xor operation. Python's exponentiation operator is ** (as in, 2**2 or 2**3).You can't directly reverse the modulus operation unless you know the number you were dividing by (call it  d), the whole number part of the result (call it w), and the remainder (which mod  finds, call it r). Mod returns a single number, so it would be impossible to tell which combination resulted. You could multiply the dividing number by the whole part (d*w) and add the remainder r to get back to the original number.For example, try 30%7 (30 mod 7). 30 divided by 7 results in 4 remainder 2. To get back to 30 you could do 4*7+2 (4*7 to get to 28, add the remainder of 2 to get to 30). Without having all 3 of those numbers the inversion would have been impossible.

URL: https://forum.audiogames.net/post/405808/#p405808




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-16 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: I need help, again!

Normally the ^ operator is exponentiation (2^2 = 2 squared, 2^3 = 2 cubed, etc). In python though ^ is the bitwise  xor operation. Python's exponentiation operator is ** (as in, 2**2 or 2**3).You can't directly reverse the modulus operation unless you know the number you were dividing by (call itt  d), the whole number part of the result (call it w), and the remainder (which mod  finds, call it r). Mod returns a single number, so it would be impossible to tell which combination resulted. You could multiply the dividing number by the whole part (d*w) and add the remainder r to get back to the original number.For example, try 30%7 (30 mod 7). 30 divided by 7 results in 4 remainder 2. To get back to 30 you could do 4*7+2 (4*7 to get to 28, add the remainder of 2 to get to 30). Without having all 3 of those numbers the inversion would have been impossible.

URL: https://forum.audiogames.net/post/405808/#p405808




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-16 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@Ethan, could you explain how to undo the modulus opparator using numbers please? I'm still in algebra, so forgive me for not being able to keep up with you. heh. I also seem to grasp things quicker and or better if you give me an _expression_ with numbers, Rather than a bunch of theory. As to your post 17, interesting... We'll see if I will need to re-code the entire thing. My hope is not to, but oh well... we all fail time to time.On another note, what does the ^ operator do? mathematically, I mean?

URL: https://forum.audiogames.net/post/405783/#p405783




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-16 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@Ethan, could you explain how to undo the modulus opparator using numbers please? I'm still in algebra, so forgive me for not being able to keep up with you. heh. I also seem to grasp things quicker and or better if you give me an _expression_ with numbers, Rather than a bunch of theory. As to your post 17, interesting... We'll see if I will need to re-code the entire thing. My hope is not to, but oh well... we all fail time to time.

URL: https://forum.audiogames.net/post/405783/#p405783




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-16 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: I need help, again!

Ord takes a character as input and returns the ascii value of that character, which in python is an integer. You are transforming the integer for the cipher, which is fine. You then call str on the result, which just turns the number into a string without actually converting the ascii code back to a character. If you replace the str call with chr (since it's only one character anyway), it should work.(edit)You call  chr to convert the ascii back to a single character, not ord.(/edit)

URL: https://forum.audiogames.net/post/405532/#p405532




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-15 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: I need help, again!

Ord takes a character as input and returns the ascii value of that character, which in python is an integer. You are transforming the integer for the cipher, which is fine. You then call str on the result, which just turns the number into a string without actually converting the ascii code back to a character. If you replace the str call with ord (since it's only one character anyway), it should work.

URL: https://forum.audiogames.net/post/405532/#p405532




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-14 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

Yeah, you messed up, and I'm honestly not sure where you went wrong with this one. I think, however, that you are over-complicating things. When I run your cipher and add a chr() call, I get back bytes (yes, literal Unicode sequences).Edit: actually, your quite close. A source I found used a string of characters to hold all the translatable symbols, and did something quite similar to what your doing. They didn't constrain it to the alphabet, either: they constrained it to the characters " !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] ^_`abcdefghijklmnopqrstuvwxyz{|}~". Furthermore, they scanned the keys used, and aborted if either (1) the first key was one, (2) the second key was zero, (3) the first or second keys were less than zero or the second key was greater than the size of the symbol table minus one, or (4) the key and the size of the symbol table were not relatively prime. (All of those are weaknesses and measures should be in place to forbid them.) Furthermore, instead of dividing the key into two separate parameters, the version I'm looking at split the two keys into two separate, distinct entities, then analyzed those halves. During the encryption process, the version looped through the message, determined if it was in the symbol table, and encrypted it. If it wasn't, it did something a bit different. During the decryption process, the version located the mod inverse of the first part of the key and the size of the symbol table, iterated through the enciphered message, and inverted the encryption if and only if the character that was examined was in the symbol table. Finally: as you don't need this method, I'll disclose what the version also did: it allowed you to generate a random, secure key. It did this by (1) infinitely generating key portions between the range 2-length of symbol table, (2) determining if the first key portion and the size of the symbol table were relatively prime, and (3) if they were relatively prime, it returned the first key times the size of the symbol table plus the second keys portion. If they didn't match, it continued generating a key until it returned a relatively prime result. I'm not giving any code like you asked, if you want to implement such a mechanism yourself.

URL: https://forum.audiogames.net/post/405460/#p405460




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-14 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Right, I think this is how the affine cipher works.Code goes below, again, replace the > with spaces.def affine(a, b, c):>message2 = "">for i in c:>>x = ord(i)>>message2+=str((a*x+b)%26)>return message2I'm sure it's broken in a way, but oh well.Now, suppose that I want to get the original string of text back. Here's a problem. I can't. Not because I'm not able to code in the method, I probably can, but because this code will spill out a bunch of numbers, like so.Input: affine(3, 5, "I am a good boy, right?")output: 162310202310232001923130472398251512Cool, right? What a giant hot mess. So, here is my main question: The way I pictured this working was adding a character that adds itself to the string, so instead of message2+=str((a*x+b)%26), we could have message2+=" "+str((a*x+b)%26). In this case, the special character that would seperate the letters would be space. My issue comes when I would create a loop, the i would equal space and python will convert the thing instead of simply ignoring it.Don't provide the code, just talk it out with me, please. Could we do a for loop with range and i increasing by 2 instead? Would we simply scrap the for loop and use a while one with it checking for the equality of the 2 string's length? Or is the cipher only meant for single letters, not words, and I am over complicating things again?

URL: https://forum.audiogames.net/post/405405/#p405405




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-11 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

Oh, no, I had fun writing all that. No bother, it was fun to see someone interested in learning about programming and cryptography.

URL: http://forum.audiogames.net/post/404683/#p404683




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-11 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

note: It seems like the forum trims my spaces for indention. I have changed the spaces to > signs, so just replace those with spaces when you run my code.@Ethin, Thanks for the explanation of the cipher. Looks like it's gonna be a joy to write, not...I have also seemed to fix the broken rot_13 method. Tell me if it works for you.Code goes below.def rot_13(message):>message2 = "">for i in message:>>x = ord(i)>>if x>=65 and x<=90:>>>x +=13>>>if x >90:>>>>x = 64+(x-90)>>elif x >=97 and x <=122:>>>x +=13>>>if x>122:>>>>x = 96+(x-122)>>message2+=chr(x)>print(message2)The code looks a bit different now, because I got told that rot_13 is only supposed to affect English alphabet and alphabet only. If you pass something like "Hello[] w__o^^rl\\d" to the code in post 12 it will shift the brackets the backslashes and the underscores instead of leaving them alone as it should. I will look at the bites module, though the point of it was to see if you could implement the logic. It wasn't the difficulty of the script, it was just to see if we learn anything in class. I'll be back with the broken affine cipher some time next week. I would like to thank you all for actually answering my questions, and I'm sorry to be such a bother. It's not the most fun thing in the world to teach a newbie, trust me, I know.

URL: http://forum.audiogames.net/post/404678/#p404678




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-11 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@Ethin, Thanks for the explanation of the cipher. Looks like it's gonna be a joy to write, not...I have also seemed to fix the broken rot_13 method. Tell me if I did it or not.Code goes below.def rot_13(message): message2 = "" for i in message:  x = ord(i)  if x>=65 and x<=90:   x +=13   if x >90:    x = 64+(x-90)  elif x >=97 and x <=122:   x +=13   if x>122:    x = 96+(x-122)  message2+=chr(x) print(message2)The code looks a bit different now, because I got told that rot_13 is only supposed to affect English alphabet and alphabet only. If you pass something like "Hello[] w__o^^rl\\d" to the code in post 12 it will shift the brackets the backslashes and the underscores instead of leaving them alone as it should. I will look at the bites module, though the point of it was to see if you could implement the logic. It wasn't the difficulty of the script, it was just to see if we learn anything in class. I'll be back with the broken affine cipher some time next week. I would like to thank you all for actually answering my questions, and I'm sorry to be such a bother. It's not the most fun thing in the world to teach a newbie, trust me, I know. Final note: It seems like the forum trims my print(message2). just add in the space if it doesn't work.

URL: http://forum.audiogames.net/post/404678/#p404678




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-11 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

@Ethin, Thanks for the explanation of the cipher. Looks like it's gonna be a joy to write, not...I have also seemed to fix the broken rot_13 method. Tell me if I did it or not.Code goes below.def rot_13(message): message2 = "" for i in message:  x = ord(i)  if x>=65 and x<=90:   x +=13   if x >90:    x = 64+(x-90)  elif x >=97 and x <=122:   x +=13   if x>122:    x = 96+(x-122)  message2+=chr(x) print(message2)The code looks a bit different now, because I got told that rot_13 is only supposed to affect English alphabet and alphabet only. If you pass something like "Hello[] w__o^^rl\\d" to the code in post 12 it will shift the brackets the backslashes and the underscores instead of leaving them alone as it should. I will look at the bites module, though the point of it was to see if you could implement the logic. It wasn't the difficulty of the script, it was just to see if we learn anything in class. I'll be back with the broken affine cipher some time next week. I would like to thank you all for actually answering my questions, and I'm sorry to be such a bother. It's not the most fun thing in the world to teach a newbie, trust me, I know.

URL: http://forum.audiogames.net/post/404678/#p404678




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-10 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

The affine cipher is a type of monoalphabetic substitution cipher. The way it works is as follows:* You pass the cipher a string* Each letter in an alphabet (i.e. the base64 or base32 alphabet) is mapped to its numeric equivalent* That numeric equivalent is encrypted with a simple mathematical function* That (now encrypted numeric equivalent) is then converted back to its alphabetic formThe formula used in the cipher means that each letter than is encrypted maps to one other letter and back again, meaning the cipher is a standard substitution cipher with a rule governing which letter maps to which. That also means that it has the same weaknesses of a substitution cipher. The simple mathematical function used to encipher (encrypt) each letter is (ax + b) mod 26, where b is the magnitude of the shift.In other words, mainly mathematical:* The letters of an alphabet of size m are first mapped to the range 0,m-1 (that is, 0 to the size of the alphabet minus one).* Modular arithmetic is then employed to map each plaintext letters' ordinal to its encrypted equivalent. That function is e(x)=(ax+b)%m, where modulus m is the size of the alphabet (determined in the first step) and a and b are the keys to the cipher. The value a must be chosen such that a and m are coprime (that is, the only positive integer (factor) that divides both of them is 1).* To decrypt the encrypted plaintext, you first get the encrypted letters ordinal, and employ the mathematical function d(x)=a^-1(x-b)%m, where a^-1 is the modular multiplicative inverse of a modulo m, i.e. it satisfies the equation 1=a(base a)^-1%m.The Caesar cipher is one such example of an affine cipher with a=1 since the encrypting function reduces to a linear shift.I know you asked for a simple explanation, but I elaborated on the cipher in case you needed it. If your going to be writing one, you'll need all that I have provided here. As for your other problem, ROT-13 can be implemented in 1 line in Python, 3 if you split it across lines for ease of readability. As a hint, look in the bytes module (automatically imported). I also just ran your code through Python, and the implementation isn't correct. When running the method I'm hinting at and giving it 'Hello world!', I get 'Uryyb jbeyq!'. When I run it through your method though, I get 'UryyC KCFyq!'. So your close, but not quite there.

URL: http://forum.audiogames.net/post/404474/#p404474




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-10 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

The affine cipher is a type of monoalphabetic substitution cipher. The way it works is as follows:* You pass the cipher a string* Each letter in an alphabet (i.e. the base64 or base32 alphabet) is mapped to its numeric equivalent* That numeric equivalent is encrypted with a simple mathematical function* That (now encrypted numeric equivalent) is then converted back to its alphabetic formThe formula used in the cipher means that each letter than is encrypted maps to one other letter and back again, meaning the cipher is a standard substitution cipher with a rule governing which letter maps to which. That also means that it has the same weaknesses of a substitution cipher. The simple mathematical function used to encipher (encrypt) each letter is (ax + b) mod 26, where b is the magnitude of the shift.In other words, mainly mathematical:* The letters of an alphabet of size m are first mapped to the range 0,m-1 (that is, 0 to the size of the alphabet minus one).* Modular arithmetic is then employed to map each plaintext letters' ordinal to its encrypted equivalent. That function is e(x)=(ax+b)%m, where modulus m is the size of the alphabet (determined in the first step) and a and b are the keys to the cipher. The value a must be chosen such that a and m are coprime (that is, the only positive integer (factor) that divides both of them is 1).* To decrypt the encrypted plaintext, you first get the encrypted letters ordinal, and employ the mathematical function d(x)=a^-1(x-b)%m, where a^-1 is the modular multiplicative inverse of a modulo m, i.e. it satisfies the equation 1=a(base a)^-1%m.The Caesar cipher is one such example of an affine cipher with a=1 since the encrypting function reduces to a linear shift.I know you asked for a simple explanation, but I elaborated on the cipher in case you needed it. If your going to be writing one, you'll need all that I have provided here. As for your other problem, ROT-13 can be implemented in 3 lines in Python. As a hint, look in the bytes module (automatically imported). I also just ran your code through Python, and the implementation isn't correct. When running the method I'm hinting at and giving it 'Hello world!', I get 'Uryyb jbeyq!'. When I run it through your method though, I get 'UryyC KCFyq!'. So your close, but not quite there.

URL: http://forum.audiogames.net/post/404474/#p404474




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-10 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So back to school we go, and one of the things we're welcomed back to is rot_13. Can anyone give me tips on shortening down code and or tell me if I implemented it correctly?Code goes below.def rot_13(message): message2 = "" for i in message:  x = ord(i)  if x>=65 and x<=122:   x +=13   if x>122:    message2+=chr(65+(x-122))   else:    message2+=chr(x)  else:   message2+=chr(x) print(message2)Very basic, I know, it was easier then the original script this topic started with, but oh well... we start small, I guess. Oh, and before I forget... Can anyone explain affine cipher? How does it work and such? Try to explain it as simply as possible, please...

URL: http://forum.audiogames.net/post/40/#p40




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-10 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So back to school we go, and one of the things we're welcomed back to is rot_13. Can anyone give me tips on shortening down code and or tell me if I implemented it correctly?Code goes below.def rot_13(message): message2 = "" for i in message:  x = ord(i)  if x>=65 and x<=122:   x +=13   if x>122:    message2+=chr(65+(x-122))   else:    message2+=chr(x)  else:   message2+=chr(x) print(message2)Very basic, I know, it was easier then the original script this topic started with, but oh well... we start small, I guess.

URL: http://forum.audiogames.net/post/40/#p40




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-07 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Post 9, yeah... I should stop with that, point noted. I'll try and write less repetitive code in the future.

URL: http://forum.audiogames.net/post/403759/#p403759




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-07 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

@8, exactly. You got it! The solution can be expressed in a much more elegant method, but this also works. As an example, in C you might bit-shift each character to the left by one and OR it with the character bit-shifted to the right by 7 ((c<<1)|(c>>7)). The advantage to that would be that the compiler is able to translate that into a very fast single instruction that does it all for you. The disadvantage is that its hard to read, and the outcome is less clear. (It also works on only one character, so it would require iteration.) In Python, there is a similar shortened method, except it is able to work on entire strings. Again though, the outcome is less clear. But this method works; it requires more instructions (and hence, more cycles), but the overhead is negligible. Great work!

URL: http://forum.audiogames.net/post/403710/#p403710




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-07 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

@8, exactly. You got it! The solution can be expressed in a much more elegant method, but this also works.

URL: http://forum.audiogames.net/post/403710/#p403710




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-07 Thread AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector


  


Re: I need help, again!

if you never want to care about going out of range, just take the input move number and mod it by 94 and then ad 32. I would just also take x as the new ASCII value stop adding move to it all the time.x = ord(i) + movemove = (x % 94) + 32

URL: http://forum.audiogames.net/post/403703/#p403703




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-07 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So is this what you're talking about when it comes to circular shifting? (note: I've also fixed the asky support, I hope...)def trashy(message, move):  message2 = ""  for i in message:    x = ord(i)    if x+move <32 or x+move >126:      print("I'm sorry, the value given is out of range, now exiting...")      return    else:      message2= message2+chr(x+move)  print("Scrambled version of the message is "+message2)  rotate(message2)def rotate(rotated):  message2 = ""  x = -1  while x < len(rotated)-1:    message2 = message2+rotated[x]    x +=1  print("Rotated version of the message: "+message2)numbermove = input("How much do you want to shift your letters by?")something = input("What is your message?")trashy(something, int(numbermove))

URL: http://forum.audiogames.net/post/403676/#p403676




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

The ASCII thing can be explained simply with an example, as below:How much do you want to shift your letters by?35What is your message?hi‹ŒThere's your problem. The problem with this code is that you don't enforce an ASCII range limit; so someone could, say, shift by 3500 characters and result in a strange, weird UTF8 mess. Even worse, you can shift by negatives:How much do you want to shift your letters by?-200What is your message?hiTraceback (most recent call last):  File "t.py", line 11, in     trashy(something, numbermove)  File "t.py", line 5, in trashy    message2= message2+chr(x+move)ValueError: chr() arg not in range(0x11)The above value error is Pythons built-in Unicode enforcement; values converted with chr() must be within the range 0-1114112 (0x0-0x11). However, that range, for the purposes of this cipher project, is far greater than what you need; a cipher that wraps around after it has reached the end of the ASCII table is fine enough. To solve this problem, determine if the ordinal of the character your scanning (and moving) results in an ordinal either greater than 126 or less than 32 (to avoid control characters.)As for your other question: a byte rotation (also known as a circular shift) is a (easy to break, but fine for this purpose) algorithm where you have a list of (in this case) bytes (which, in the usual case, is in a tuple, but a string will suffice). In the algorithm, you take all the entries (bytes) in that tuple (string) and rearrange them such that the last entry (byte) in the tuple (string) is moved (rotated or shifted) to the first position and all other entries (bytes) are moved into the next sequential position in the tuple (string). So, take the string "hello". If you perform a circular shift on that string, o is moved (shifted) to the position of h, and h, e, l, and l are moved (shifted) such that they fill the remaining space of the string, thereby creating the string "ohell".To aid you, I'll leave you with the following nugget of info: a circular shift (byte rotation) is a permutation s of the n bytes in the string such that either the sigma of i is identical to (i+1)%n, for all bytes i=1, n; or the sigma of i is identical to (i-1)%n, for all bytes i=1, n. The algorithm is repetitive, which I'll demonstrate twice below. If your implementation is correct, it should follow the following steps (though obviously this is heavily dependent on the string your passing it), assuming 'abcd' is your string:* Input: abcd* abcd becomes dabc* input: dabc* dabc becomes cdab* input: cdab* cdab becomes bcad* input: bcad* bcad becomes abcd (original input)As such, if this is a homework assignment, and if your teacher uses the string "hello", and repeatedly applies your implementation to the string, something like the following should happen:* teacher passes in "hello"* "hello" becomes "ohell"* "ohell" becomes "lohel"* "lohel" becomes "llohe"* "llohe" becomes "elloh"* "elloh" becomes "hello" (original input)Hope this helps!

URL: http://forum.audiogames.net/post/403595/#p403595




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

The ASCII thing can be explained simply with an example, as below:How much do you want to shift your letters by?35What is your message?hi‹ŒThere's your problem. The problem with this code is that you don't enforce an ASCII range limit; so someone could, say, shift by 3500 characters and result in a strange, weird UTF8 mess. Even worse, you can shift by negatives:How much do you want to shift your letters by?-200What is your message?hiTraceback (most recent call last):  File "t.py", line 11, in     trashy(something, numbermove)  File "t.py", line 5, in trashy    message2= message2+chr(x+move)ValueError: chr() arg not in range(0x11)The above value error is Pythons built-in Unicode enforcement; values converted with chr() must be within the range 0-1114112 (0x0-0x11). However, that range, for the purposes of this cipher project, is far greater than what you need; a cipher that wraps around after it has reached the end of the ASCII table is fine enough. To solve this problem, determine if the ordinal of the character your scanning (and moving) results in an ordinal either greater than 126 or less than 32 (to avoid control characters.)As for your other question: a byte rotation (also known as a circular shift) is a (easy to break, but fine for this purpose) algorithm where you have a list of (in this case) bytes (which, in the usual case, is in a tuple, but a string will suffice). In the algorithm, you take all the entries (bytes) in that tuple (string) and rearrange them such that the last entry (byte) in the tuple (string) is moved (rotated or shifted) to the first position and all other entries (bytes) are moved into the next sequential position in the tuple (string). So, take the string "hello". If you perform a circular shift on that string, o is moved (shifted) to the position of h, and h, e, l, and l are moved (shifted) such that they fill the remaining space of the string, thereby creating the string "ohell".To aid you, I'll leave you with the following nugget of info: a circular shift (byte rotation) is a permutation s of the n bytes in the string such that either the sigma of i is identical to (i+1)%n, for all bytes i=1, n; or the sigma of i is identical to (i-1)%n, for all bytes i=1, n. If your implementation is correct, it should follow the following steps (though oviously this is heavily dependent on the string your passing it), assuming 'abcd' is your string:* Input: abcd* abcd becomes dabc* dabc becomes cdab* cdab becomes bcad* bcad becomes abcd (original input)As such, if this is a homework assignment, and if your teacher uses the string "hello", and repeatedly applies your implementation to the string, something like the following should happen:* teacher passes in "hello"* "hello" becomes "ohell"* "ohell" becomes "lohel"* "lohel" becomes "llohe"* "llohe" becomes "elloh"* "elloh" becomes "hello" (original input)Hope this helps!

URL: http://forum.audiogames.net/post/403595/#p403595




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: I need help, again!

The ASCII thing can be explained simply with an example, as below:How much do you want to shift your letters by?35What is your message?hi‹ŒThere's your problem. The problem with this code is that you don't enforce an ASCII range limit; so someone could, say, shift by 3500 characters and result in a strange, weird UTF8 mess. Even worse, you can shift by negatives:How much do you want to shift your letters by?-200What is your message?hiTraceback (most recent call last):  File "t.py", line 11, in     trashy(something, numbermove)  File "t.py", line 5, in trashy    message2= message2+chr(x+move)ValueError: chr() arg not in range(0x11)The above value error is Pythons built-in Unicode enforcement; values converted with chr() must be within the range 0-1114112 (0x0-0x11). However, that range, for the purposes of this cipher project, is far greater than what you need; a cipher that wraps around after it has reached the end of the ASCII table is fine enough. To solve this problem, something like:def trashy(message, move):
  message2 = ""
  for i in message:
x = ord(i)
if x>126 or x<32: # avoid both control characters and DEL
  # deal with it here
message2= message2+chr(x+move)
  print(message2)
print("How much do you want to shift your letters by?")
numbermove = int(input())
print("What is your message?")
something = input()
trashy(something, numbermove)would suffice. As for the byte rotation... a byte rotation (also known as a circular shift) is a (easy to break, but fine for this purpose) algorithm where you have a list of (in this case) bytes (which, in the usual case, is in a tuple, but a string will suffice). In the algorithm, you take all the entries (bytes) in that tuple (string) and rearrange them such that the last entry (byte) in the tuple (string) is moved (rotated or shifted) to the first position and all other entries (bytes) are moved into the next sequential position in the tuple (string). So, take the string "hello". If you perform a circular shift on that string, o is moved (shifted) to the position of h, and h, e, l, and l are moved (shifted) such that they fill the remaining space of the string, thereby creating the string "ohell". In python, this might be accomplished via a method like:def rotate(string: str)->str:
  return string[-1] + string[:-1]Of course, figure out your own method; don't copy-paste mine. Otherwise you won't learn anything. To aid you, I'll leave you with the following nugget of info: a circular shift (byte rotation) is a permutation s of the n bytes in the string such that either the sigma of i is identical to (i+1)%n, for all bytes i=1, n; or the sigma of i is identical to (i-1)%n, for all bytes i=1, n. If your implementation is correct, it should follow the following steps (though oviously this is heavily dependent on the string your passing it), assuming 'abcd' is your string:* Input: abcd* abcd becomes dabc* dabc becomes cdab* cdab becomes bcad* bcad becomes abcd (original input)As such, if this is a homework assignment, and if your teacher uses the string "hello", and repeatedly applies your implementation to the string, something like the following should happen:* teacher passes in "hello"* "hello" becomes "ohell"* "ohell" becomes "lohel"* "lohel" becomes "llohe"* "llohe" becomes "elloh"* "elloh" becomes "hello" (original input)Hope this helps!

URL: http://forum.audiogames.net/post/403595/#p403595




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Okay, I was an idiot. I forgot to review the screen. Thanks post 4.A question: Yes: I was aiming at a Caesar cipher. What do you mean by it failing? Can you show me an example of it failing and give me a tip at how to fix it? Don't give the code, I don't want that. Give a general nudge so I can have a chance of discovering the thing myself, please.Can you also explain supporting asky and bite rotation? As in what it is and why it's not an actual decryption and a simple rotation of bites, as you called them?Again, I'm sorry. I wish I'd know more then what I do now, but I think that can be said for all of us, heh.

URL: http://forum.audiogames.net/post/403583/#p403583




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Okay, I was an idiot. I forgot to review the screen. Thanks post 4.A question: Yes: I was aiming at a Caesar cipher. What do you mean by it failing? Can you show an example and give me a tip at how to fix it? Don't give the code, I don't want that. Give a general nudge so I can have a chance of discovering the thing myself, please.Can you also explain supporting asky and bite rotation? As in what it is and why it's not an actual decryption and a simple rotation of bites, as you called them?Again, I'm sorry. I wish I'd know more then what I do now, but I think that can be said for all of us, heh.

URL: http://forum.audiogames.net/post/403583/#p403583




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: I need help, again!

Well, what if it IS printing the message, but the message is an empty string? Something I do sometimes to track down irritating bugs is litter my code with print statements to try and get an idea of what may be causing it. So the first thing you could do is maybe change the initialization of message2 to something other than a blank string and see if anything happens, and then check how far the code gets before something goes wrong, like:def trashy(message, move):
  message2 = ""
  print('3')
  for i in message:
print('4',message2+chr(c+move))
x = ord(i)
message2= message2+chr(x+move)
  print('5')
  print(message2)

numbermove = input("How much do you want to shift your letters by?")
print('1')
something = input("What is your message?")
print('2')
trashy(something, int(numbermove))
print('6')

URL: http://forum.audiogames.net/post/403585/#p403585




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Okay, I was an idiot. I forgot to review the screen. Thanks post 4.A question: Yes: I was aiming at a

URL: http://forum.audiogames.net/post/403583/#p403583




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

Okay so can you have any clew as to what to check? The script runs... And then exits without printing the message. Why! No error is given, no nothing, it's just sitting there.

URL: http://forum.audiogames.net/post/403583/#p403583




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: I need help, again!

Hi,@CarterTemm: yeah, didn't know that topic and thus didn't know this Python 3 thingy. I got both versions installed and tried with Python 2, which didn't work, thats why i replaced it and voilla.Didn't mention the ascii range though, this code looked like some tutorial or class homework thing and I guessed he'll have to cover this topic next. Thanks for clarifying anyway .Best Regards.Hijacker

URL: http://forum.audiogames.net/post/403572/#p403572




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: I need help, again!

OP said he was using python 3 in a previous topic. raw_input is a python 2 thing, replaced with input in any later version.Original script works fine for me. Never run interactive applications from the run dialog, as the run dialog is not at all meant for displaying output.Open up cmd, cd documents\pythonpy -3 shifter.pyHow much do you want to shift your letters by?2What is your message?hijkAlso as an afterthought, you might want to add support for an Ascii range. It seems as if your wanting to shift letters and letters only, as in the Caesar cipher. right now your performing a rough form of byte rotation, and even that fails to some extent.

URL: http://forum.audiogames.net/post/403555/#p403555




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: I need help, again!

OP said he was using python 3 in a previous topic. raw_input is a python 2 thing, replaced with input in any later version.Original script works fine for me. Never run interactive applications from the run dialog, as the run dialog is not at all meant for displaying output.Open up cmd, cd documents\pythonpy -3 shifter.pyHow much do you want to shift your letters by?2What is your message?hijkAlso as an afterthought, you might want to add support for an Ascii range. It seems as if your wanting to shift letters and letters only, as in the Caesar cipher. right now your performing byte rotation, and even that fails to some extent.

URL: http://forum.audiogames.net/post/403555/#p403555




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: I need help, again!

OP said he was using python 3 in a previous topic. raw_input is a python 2 thing, replaced with input in any later version.Original script works fine for me. Never run interactive applications from the run dialog, as the run dialog is not at all meant for displaying output.Open up cmd, cd documents\pythonpy -3 shifter.pyHow much do you want to shift your letters by?2What is your message?hijk

URL: http://forum.audiogames.net/post/403555/#p403555




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: I need help, again!

So here's my code, which is still broken:def trashy(message, move):  message2 = ""  for i in message:    x = ord(i)    message2= message2+chr(x+move)  print(message2)print("How much do you want to shift your letters by?")numbermove = int(raw_input())print("What is your message?")something = raw_input()trashy(something, numbermove)What's wrong with it this time? The raw_input function has been renamed to input in python 3, so why didn't it work earlier?

URL: http://forum.audiogames.net/post/403500/#p403500




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: I need help, again!

2019-01-06 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: I need help, again!

Hi,well, exchange input against raw_input and it will actually work.D:\>python run.py
How much do you want to shift your letters by?2
What is your message?hello
jgnnqBest Regards.Hijacker

URL: http://forum.audiogames.net/post/403477/#p403477




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector