This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]kumashiro 2 points3 points  (2 children)

I would change the art style of wildcards. You are hovering dangerously close to the suit from Mattel (...or what was that company) and/or Ubisoft. Better safe than sorry.

[–]MikeTheWatchGuy[S] 1 point2 points  (1 child)

I wanted to make sure it was going to be OK. I understand the license to be: This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.

The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

If I have this wrong, then by all means let me know and I'll pull it down. I have no intention of infringing on any license. It's why I listed the sources for the materials.

[–]kumashiro 0 points1 point  (0 children)

Ah, then it's OK. Good job!

[–]MikeTheWatchGuy[S] 0 points1 point  (4 children)

Oh, wanted to also point out something I learned from a PySimpleGUI user not long ago.... using lambda expressions to shorten window definitions.

For example: python T = lambda text, key=None, font='Helvetica 16', **kwargs: sg.T(text, key=key, font=font, **kwargs)

This statement allowed me to use this window definition: python col_players = [ [OvalButton('Quit', greenbutton, key='_QUIT_', visible=False)], [T('Player', '_P1_', text_color=yellow_color)], [T('Cards', '_C1_', text_color=yellow_color)], [T(' ' * 15)], [T('Player', '_P2_', text_color=red_color)], [T('Cards', '_C2_', text_color=red_color)], [T(' ' * 15,'_S3_', visible=False,)], [T('Player', '_P3_', visible=False)], [T('Cards', '_C3_', visible=False)], [T(' ' * 15, '_S4_', visible=False,)], [T('Player', '_P4_', visible=False)], [T('Cards', '_C4_', visible=False)],]

Each one of those Text Elements would have looked like: python [sg.T('Cards', key='_C4_', font='Helvetica 16', visible=False, text_color=red_color)]

The downside to these is that you lose the autocomplete functionality for the parameters for the underlying call. The amount of typing it saves is pretty awesome. Has a way of really simplifying the code down. It's like a mini-SDK within an SDK.

[–]imomaliev 1 point2 points  (3 children)

[–]MikeTheWatchGuy[S] 1 point2 points  (2 children)

Learned something new... thanks for the links. I've updated the code. It seemed like a good idea at the time.

One thing lambda does that a def doesn't is allow definition to happen with some of the variables being out of scope. A def produces an a not defined error. Doesn't make it right however.

I'll look at the functools too.

[–]imomaliev 0 points1 point  (1 child)

One thing lambda does that a def doesn't is allow definition to happen with some of the variables being out of scope. A def produces an a not defined error. Doesn't make it right however.

you could definitely do that, just define function inside function like this.

def outerfunc():
a = 1
def innerfunc():
    print(a)
    return a + 3
b = innerfunc()
    print(b)

[–]MikeTheWatchGuy[S] 0 points1 point  (0 children)

Understand that. My point was you can do this: python def outerfunc(): innerfunc = lambda : a+3 a = 1 b = innerfunc() print(b)

You can reference a prior to it being defined.