Puzzles , logic and lateral thinking .

Chat about just about anything else
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Faust

Re: Puzzles , logic and lateral thinking .

Post by Faust »

gm10 wrote: Mon Nov 05, 2018 3:42 am
Faust wrote: Sun Nov 04, 2018 4:52 am I'm convinced that there is some sort of connection between the ability to solve these things quickly
and being able to write neat , efficient and compact code ...... [ discuss and debate - :) ]
I like how nobody is actually discussing and/or debating this. ;)
Yes , I was hoping for a lively discussion there , just as much as someone quickly coming up with the answer ,
or posing other similar riddles .... Oh Well
gm10 wrote: Mon Nov 05, 2018 3:42 am ....
Ok, so there's 73 letters in the question, if you remove the letter count for seventy three you get 61. But that's an ambiguous conclusion since any modification to the length of the question changes the answer,
........
You are on the right track ....
Minor hint :-
The question intentionally has distraction built into it .
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Puzzles , logic and lateral thinking .

Post by catweazel »

Faust wrote: Sun Nov 04, 2018 4:52 am How many letters would this question contain if the answer wasn't already seventy three ?
Last edited by catweazel on Mon Nov 05, 2018 4:50 am, edited 1 time in total.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
gm10

Re: Puzzles , logic and lateral thinking .

Post by gm10 »

Faust wrote: Mon Nov 05, 2018 4:18 am Yes , I was hoping for a lively discussion there , just as much as someone quickly coming up with the answer ,
or posing other similar riddles .... Oh Well
Well, if your hypothesis proves true then all who answered so far are terrible coders. ;)

I don't think it's true though. Lateral thinking helps you find creative ways to solve problems, not necessarily write neat code. Take a code example from Mint's Update Manager:

https://github.com/linuxmint/mintupdate ... els.py#L47

Code: Select all

            version_array = pkg_version.replace("-", ".").split(".")
            versions = []
            for element in version_array:
                if len(element) == 1:
                    element = "00%s" % element
                elif len(element) == 2:
                    element = "0%s" % element
                versions.append(element)
How I would write it:

Code: Select all

            versions = pkg_version.replace("-", ".").split(".")
            for i, element in enumerate(versions):
                versions[i] = (3 - len(element)) * "0" + element
Now I'd submit my approach would be much more neat, concise and efficient, but I don't think it's due to lateral thinking. There is nothing surprising about my approach, the original approach is just very step-by-step, lacking abstraction.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Puzzles , logic and lateral thinking .

Post by catweazel »

catweazel wrote: Mon Nov 05, 2018 4:22 am
Faust wrote: Sun Nov 04, 2018 4:52 am How many letters would this question contain if the answer wasn't already seventy three ?
[Elided] by request.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Puzzles , logic and lateral thinking .

Post by catweazel »

gm10 wrote: Mon Nov 05, 2018 4:43 am Well, if your hypothesis proves true then all who answered so far are terrible coders. ;)
HURRUMPH!

Code: Select all

QSortFilterProxyModel* databaseManager::getPragmasModel()
{
    QSqlQueryModel* dataModelPragmas = new QSqlQueryModel(this);
    QSortFilterProxyModel* dataModelProxyPragmas = new QSortFilterProxyModel(this);
    QString sqlSelect = "SELECT * FROM %1 ORDER BY Property ASC;";

    sqlSelect = sqlSelect.arg(pragmasDbTableName);
    dataModelPragmas->setQuery(sqlSelect);
    dataModelProxyPragmas->setSourceModel(dataModelPragmas);

    return dataModelProxyPragmas;
}

//
// Gets the data for a specified table
//
QSqlTableModel* databaseManager::getTableData(QString tableName)
{
    tableModelCurrentTable = new QSqlTableModel(this);
    tableModelCurrentTable->setTable(tableName);
    tableModelCurrentTable->setEditStrategy(QSqlTableModel::OnFieldChange);
    tableModelCurrentTable->select();

    return tableModelCurrentTable;
}

void databaseManager::createEmptyDatabase(QString fullyQualifiedPathToFile)
{
    // Create the empty databse file
    closeDatabase();
    database = QSqlDatabase::addDatabase(sqlite3QtDriverType);
    database.setDatabaseName(fullyQualifiedPathToFile);
    database.open();
    // Create a dummy table then drop it. We do this to make sure
    // that we don't try to open an empty file:
    database.exec("CREATE TABLE x (y TEXT, z TEXT);");
    database.exec("DROP TABLE x;");
    // Close the new database then reopen using the standard method
    closeDatabase();
    openDatabase(fullyQualifiedPathToFile);
}
Oh, and I have the answer. @Faust asked me to hold it :twisted:
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
gm10

Re: Puzzles , logic and lateral thinking .

Post by gm10 »

catweazel wrote: Mon Nov 05, 2018 4:52 am Oh, and I have the answer. @Faust asked me to hold it :twisted:
Yeah, we all know how to use Google. But takes the fun out of things, so I refused to follow your link to the BBC (which I assume you google'd or similar) ;)

I don't have the answer though. ;)
User avatar
AndyMH
Level 21
Level 21
Posts: 13742
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Puzzles , logic and lateral thinking .

Post by AndyMH »

Thanks for all the fish.
What about the mice?
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Puzzles , logic and lateral thinking .

Post by catweazel »

gm10 wrote: Mon Nov 05, 2018 4:55 am
catweazel wrote: Mon Nov 05, 2018 4:52 am Oh, and I have the answer. @Faust asked me to hold it :twisted:
Yeah, we all know how to use Google. But takes the fun out of things, so I refused to follow your link to the BBC (which I assume you google'd or similar) ;)
<WEIL> <-- Wide-eyed innocent look.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
lsemmens
Level 11
Level 11
Posts: 3950
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Puzzles , logic and lateral thinking .

Post by lsemmens »

30
Fully mint Household
Out of my mind - please leave a message
Faust

Re: Puzzles , logic and lateral thinking .

Post by Faust »

gm10 wrote: Mon Nov 05, 2018 4:55 am .....
I don't have the answer though. ;)
I'll give another hint ....
.... in a while :wink:
User avatar
lsemmens
Level 11
Level 11
Posts: 3950
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Puzzles , logic and lateral thinking .

Post by lsemmens »

I apologise, I miscounted 37,.
Fully mint Household
Out of my mind - please leave a message
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Puzzles , logic and lateral thinking .

Post by MrEen »

12?
gm10

Re: Puzzles , logic and lateral thinking .

Post by gm10 »

Faust wrote: Mon Nov 05, 2018 5:33 am I'll give another hint ....
.... in a while :wink:
So your hint is ".... in a while" or you will give another hint in a while? I am a simple minded person, this ambiguity is killing me. :lol: ;)
philotux

Re: Puzzles , logic and lateral thinking .

Post by philotux »

38 :idea:
Faust

Re: Puzzles , logic and lateral thinking .

Post by Faust »

12 No
30 No

.... a distant memory from exams at school ?
" Show your workings in the margin "
:D
gm10 wrote: Mon Nov 05, 2018 8:27 am
So your hint is ".... in a while" or you will give another hint in a while? I am a simple minded person, this ambiguity is killing me. :lol: ;)
No , "in a while" is NOT the hint ..... :)
This is the hint :-

The letter count is a number , "seventy three " is the text for a number , proceed accordingly
gm10

Re: Puzzles , logic and lateral thinking .

Post by gm10 »

Faust wrote: Mon Nov 05, 2018 9:56 am The letter count is a number , "seventy three " is the text for a number , proceed accordingly
Heh, I had considered that when you said misdirection in the previous hint, but I cannot say it made sense to me so I'll only reluctantly say 71 but if it's correct then I say "I don't get it" at the same time. ;)
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Puzzles , logic and lateral thinking .

Post by MrEen »

Ahh, 2.

EDIT: Nah, that can't be correct.
mediclaser
Level 4
Level 4
Posts: 492
Joined: Tue Mar 20, 2018 2:28 pm

Re: Puzzles , logic and lateral thinking .

Post by mediclaser »

gm10 wrote: Mon Nov 05, 2018 3:42 am ... But that's an ambiguous conclusion since any modification to the length of the question changes the answer, ...
I have personally ran into similar problem when I was learning to code. I was trying to make an executable file that validates its own checksum.
If you're looking for a greener Linux pasture, you won't find any that is greener than Linux Mint. ;)
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Puzzles , logic and lateral thinking .

Post by MrEen »

Zero. Goose egg. Big fat NADA. The question wouldn't exist!
HaveaMint
Level 6
Level 6
Posts: 1085
Joined: Fri Feb 02, 2018 9:56 pm

Re: Puzzles , logic and lateral thinking .

Post by HaveaMint »

MrEen wrote: Mon Nov 05, 2018 10:57 am Zero. Goose egg. Big fat NADA. The question wouldn't exist!
Already been guessed.
Last edited by HaveaMint on Mon Nov 05, 2018 12:07 pm, edited 1 time in total.
"Tune for maximum Smoke and then read the Instructions".
Locked

Return to “Open Chat”